Changeset 322 in ProjectBuilder for devel/pb


Ignore:
Timestamp:
Feb 19, 2008, 5:31:31 PM (16 years ago)
Author:
Bruno Cornec
Message:

Trying to solve the remaining issues for upstream projects with local CMS (begin)

Location:
devel/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r320 r322  
    511511    if ($cmt eq "vm") {
    512512        $login = "vmlogin";
    513         $dir = "pbdir";
     513        $dir = "pbdefdir";
    514514        $tmout = "vmtmout";
    515515        $rebuild = "vmrebuild";
     
    519519    } elsif ($cmt eq "ve") {
    520520        $login = "velogin";
    521         $dir = "pbdir";
     521        $dir = "pbdefdir";
    522522        $tmout = "vetmout";
    523523        # Specific VE
  • devel/pb/lib/ProjectBuilder/Base.pm

    r321 r322  
    5858# and use its content
    5959#
    60 my ($pbconf) = pb_conf_read("$ENV{'PBETC'}","pbconf");
    61 pb_log(2,"DEBUG pbconf: ".Dumper($pbconf)."\n");
     60my ($pbconf) = pb_conf_read("$ENV{'PBETC'}","pbconfurl");
     61pb_log(2,"DEBUG pbconfurl: ".Dumper($pbconf)."\n");
    6262
    6363my %pbconf = %$pbconf;
     
    6767    if (defined $proj) {
    6868        pb_log(0,"WARNING: using $proj as default project as none has been specified\n");
    69         pb_log(0,"         Please either create a pbconf reference for project $proj in $ENV{'PBETC'}\n");
     69        pb_log(0,"         Please either create a pbconfurl reference for project $proj in $ENV{'PBETC'}\n");
    7070        pb_log(0,"         or call pb with the -p project option or use the env var PBPROJ\n");
    7171        pb_log(0,"         if you want to use another project\n");
    7272    }
    7373}
    74 die "No project defined - use env var PBPROJ or -p proj or a pbconf entry in $ENV{'PBETC'}" if (not (defined $proj));
     74die "No project defined - use env var PBPROJ or -p proj or a pbconfurl entry in $ENV{'PBETC'}" if (not (defined $proj));
    7575
    7676# That's always the environment variable that will be used
     
    7979
    8080if (not defined ($pbconf{$ENV{'PBPROJ'}})) {
    81     die "Please create a pbconf reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n";
     81    die "Please create a pbconfurl reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n";
    8282}
    8383
     
    8787# Tree will look like this:
    8888#
    89 #             maint pbdir                            PBDIR               dev dir (optional)   PBDEVDIR
     89#             maint pbdefdir                         PBDEFDIR            dev dir (optional)   PBDEVDIR
    9090#                  |                                                        |
    9191#            ------------------------                                --------------------
     
    9494#            |                                                       |
    9595#  ---------------------------------------------                ----------
    96 #  *      *        |       |        |          |                *        *
     96#  *      *        *       |        |          |                *        *
    9797# 1.0    dev    pbconf    ...     build     delivery PBCONF    dev      tag                   PBDEVROOT
    9898#                  |                           |     PBDESTDIR           |
     
    114114#
    115115#
    116 # (*) By default, if no relocation in .pbrc, dev dir is taken in the maint pbdir (when appropriate)
     116# (*) By default, if no relocation in .pbrc, dev dir is taken in the maint pbdefdir (when appropriate)
    117117# Names under a pbproj and the corresponding pbconf should be similar
    118118#
    119119
    120 my ($pbdir) = pb_conf_get_if("pbdir");
    121 my %pbdir = %$pbdir;
    122 
    123 if (not defined $ENV{'PBDIR'}) {
    124     if ((not defined $pbdir) || (not defined $pbdir{$ENV{'PBPROJ'}})) {
    125         pb_log(0,"WARNING: no pbdir defined, using /var/cache\n");
    126         pb_log(0,"         Please create a pbdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
     120my ($pbdefdir) = pb_conf_get_if("pbdefdir");
     121my %pbdefdir = %$pbdefdir;
     122
     123if (not defined $ENV{'PBDEFDIR'}) {
     124    if ((not defined $pbdefdir) || (not defined $pbdefdir{$ENV{'PBPROJ'}})) {
     125        pb_log(0,"WARNING: no pbdefdir defined, using /var/cache\n");
     126        pb_log(0,"         Please create a pbdefdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
    127127        pb_log(0,"         if you want to use another directory\n");
    128         $ENV{'PBDIR'} = "/var/cache";
     128        $ENV{'PBDEFDIR'} = "/var/cache";
    129129    } else {
    130130        # That's always the environment variable that will be used
    131         $ENV{'PBDIR'} = $pbdir{$ENV{'PBPROJ'}};
     131        $ENV{'PBDEFDIR'} = $pbdefdir{$ENV{'PBPROJ'}};
    132132    }
    133133}
    134134# Expand potential env variable in it
    135 eval { $ENV{'PBDIR'} =~ s/(\$ENV.+\})/$1/eeg };
    136 
    137 pb_log(2,"PBDIR: $ENV{'PBDIR'}\n");
     135eval { $ENV{'PBDEFDIR'} =~ s/(\$ENV.+\})/$1/eeg };
     136
     137pb_log(2,"PBDEFDIR: $ENV{'PBDEFDIR'}\n");
    138138#
    139139# Set delivery directory
    140140#
    141 $ENV{'PBDESTDIR'}="$ENV{'PBDIR'}/$ENV{'PBPROJ'}/delivery";
     141$ENV{'PBDESTDIR'}="$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/delivery";
    142142
    143143pb_log(2,"PBDESTDIR: $ENV{'PBDESTDIR'}\n");
     
    165165# Set build directory
    166166#
    167 $ENV{'PBBUILDDIR'}="$ENV{'PBDIR'}/$ENV{'PBPROJ'}/build";
     167$ENV{'PBBUILDDIR'}="$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/build";
    168168if (! -d "$ENV{'PBBUILDDIR'}") {
    169169    pb_mkdir_p($ENV{'PBBUILDDIR'}) || die "Unable to recursively create $ENV{'PBBUILDDIR'}";
     
    190190# Check pbconf compliance
    191191#
    192 $ENV{'PBCONF'} = "$ENV{'PBDIR'}/$ENV{'PBPROJ'}/pbconf";
     192my ($pbconfdir) = pb_conf_get_if("pbconfdir");
     193my %pbconfdir = %$pbconfdir;
     194
     195if ((defined $pbconfdir) && (defined $pbconfdir{$ENV{'PBPROJ'}})) {
     196    # That's always the environment variable that will be used
     197    $ENV{'PBCONF'} = $pbconfdir{$ENV{'PBPROJ'}};
     198} else {
     199    pb_log(0,"WARNING: no pbconfdir defined, using $ENV{'PBDIR'}/$ENV{'PBPROJ'}/pbconf\n");
     200    pb_log(0,"         Please create a pbconfdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
     201    pb_log(0,"         if you want to use another directory\n");
     202    $ENV{'PBCONF'} = "$ENV{'PBDIR'}/$ENV{'PBPROJ'}/pbconf";
     203}
    193204pb_log(2,"PBCONF: $ENV{'PBCONF'}\n");
    194205
Note: See TracChangeset for help on using the changeset viewer.