Changeset 1584 in ProjectBuilder for devel/pb-modules


Ignore:
Timestamp:
May 24, 2012, 12:10:50 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Move PBPROJ env var setuo from Env.pm to Conf.pm to have it earlier available for some calls with less context.
  • Fix a bug when (ve|vm|rm)path->ENV(PBPROJ) was undefined, and expand its path when defined to support that type of definition in conf files (pbtest does it)
  • getconf now loads more conf files, and calls cms_compliant
Location:
devel/pb-modules/lib/ProjectBuilder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r1538 r1584  
    8181
    8282pb_log(1,"Entering pb_conf_init\n");
     83#
     84# Check project name
     85# Could be with env var PBPROJ
     86# or option -p
     87# if not defined take the first in conf file
     88#
     89if ((defined $ENV{'PBPROJ'}) &&
     90    (not defined $proj)) {
     91    pb_log(2,"PBPROJ env var setup ($ENV{'PBPROJ'}) so using it\n");
     92    $proj = $ENV{'PBPROJ'};
     93}
     94
    8395if (defined $proj) {
    8496    $ENV{'PBPROJ'} = $proj;
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r1556 r1584  
    151151
    152152#
    153 # Check project name
    154 # Could be with env var PBPROJ
    155 # or option -p
    156 # if not defined take the first in conf file
    157 #
    158 if ((defined $ENV{'PBPROJ'}) &&
    159     (not (defined $proj))) {
    160     $proj = $ENV{'PBPROJ'};
    161 }
    162 
    163 #
    164153# We get the pbconf file for that project
    165154# and use its content
     
    192181# important than the project conf file
    193182my ($vmpath,$vepath,$rmpath) = pb_conf_get_if("vmpath","vepath","rmpath");
    194 pb_conf_add("$vmpath->{$ENV{'PBPROJ'}}/.pbrc") if ((defined $vmpath) && (-f "$vmpath->{$ENV{'PBPROJ'}}/.pbrc"));
    195 pb_conf_add("$vepath->{$ENV{'PBPROJ'}}/.pbrc") if ((defined $vepath) && (-f "$vepath->{$ENV{'PBPROJ'}}/.pbrc"));
    196 pb_conf_add("$rmpath->{$ENV{'PBPROJ'}}/.pbrc") if ((defined $rmpath) && (-f "$rmpath->{$ENV{'PBPROJ'}}/.pbrc"));
     183foreach my $p ($vmpath,$vepath,$rmpath) {
     184    if ((defined $p) && (defined $p->{$ENV{'PBPROJ'}})) {
     185        $p->{$ENV{'PBPROJ'}} = pb_path_expand($p->{$ENV{'PBPROJ'}});
     186        pb_conf_add("$p->{$ENV{'PBPROJ'}}/.pbrc") if (-f "$p->{$ENV{'PBPROJ'}}/.pbrc");
     187    }
     188}
    197189
    198190#
     
    312304#
    313305
    314 if (($action =~ /^cms2/) || ($action =~ /^sbx2/) || ($action =~ /^newver$/) || ($action =~ /pbinit/) || ($action =~ /^newproj$/) || ($action =~ /^announce/) || ($action =~ /^checkssh/) || ($action =~ /^cleanssh/)) {
     306if ($action =~ /^(cms2|sbx2|newver|pbinit|newproj|announce|checkssh|cleanssh|getconf)/) {
    315307
    316308    #
     
    344336    pb_conf_add("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb") if (-f "$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb");
    345337
    346     return if ($action =~ /^newver$/);
     338    return if ($action =~ /^(newver|getconf)$/);
    347339
    348340    my %version = ();
Note: See TracChangeset for help on using the changeset viewer.