Changeset 339


Ignore:
Timestamp:
Mar 29, 2008, 6:11:54 PM (11 years ago)
Author:
bruno
Message:
  • PBROOT => PBROOTDIR, Use of PBPROJDIR
  • works for pb and mondorescue from SVN
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/ProjectBuilder/Base.pm

    r333 r339  
    3232
    3333our @ISA = qw(Exporter);
    34 our @EXPORT = qw(pb_env_init pb_conf_read pb_conf_read_if pb_conf_get pb_conf_get_if pb_cms_init pb_mkdir_p pb_system pb_rm_rf pb_get_filters pb_filter_file pb_filter_file_pb pb_filter_file_inplace pb_cms_export pb_cms_log pb_cms_isdiff pb_cms_copy pb_cms_checkout pb_get_date pb_log pb_log_init pb_get_pkg pb_cms_compliant pb_get_uri pb_cms_get_uri $debug $LOG);
     34our @EXPORT = qw(pb_env_init pb_conf_read pb_conf_read_if pb_conf_get pb_conf_get_if pb_cms_init pb_mkdir_p pb_system pb_rm_rf pb_get_filters pb_filter_file pb_filter_file_pb pb_filter_file_inplace pb_cms_export pb_cms_log pb_cms_isdiff pb_cms_copy pb_cms_checkout pb_get_date pb_log pb_log_init pb_get_pkg pb_get_uri pb_cms_get_uri $debug $LOG);
    3535
    3636$ENV{'PBETC'} = "$ENV{'HOME'}/.pbrc";
     
    6666    $proj = (keys %pbconf)[0];
    6767    if (defined $proj) {
    68         pb_log(0,"WARNING: using $proj as default project as none has been specified\n");
    69         pb_log(0,"         Please either create a pbconfurl reference for project $proj in $ENV{'PBETC'}\n");
    70         pb_log(0,"         or call pb with the -p project option or use the env var PBPROJ\n");
    71         pb_log(0,"         if you want to use another project\n");
     68        pb_log(1,"WARNING: using $proj as default project as none has been specified\n");
     69        pb_log(1,"         Please either create a pbconfurl reference for project $proj in $ENV{'PBETC'}\n");
     70        pb_log(1,"         or call pb with the -p project option or use the env var PBPROJ\n");
     71        pb_log(1,"         if you want to use another project\n");
    7272    }
    7373}
     
    9191#            ------------------------                                --------------------
    9292#            |                      |                                |                  |
    93 #         pbproj1                pbproj2             PBPROJ       pbproj1           pbproj2
     93#         pbproj1                pbproj2             PBPROJ       pbproj1           pbproj2   PBPROJDIR
    9494#            |                                                       |
    9595#  ---------------------------------------------                ----------
    9696#  *      *        *       |        |          |                *        *
    97 # tag    dev    pbconf    ...     build     delivery PBCONF    dev      tag                 
     97# tag    dev    pbconf    ...     build     delivery PBCONFDIR dev      tag                 
    9898#  |               |                           |     PBDESTDIR           |
    9999#  ---          ------                        pbrc   PBBUILDDIR       -------
    100100#    |          |    |                                                |     |
    101 #   1.1        dev  tag                              PBROOT          1.0   1.1                PBDIR
     101#   1.1        dev  tag                                              1.0   1.1                PBDIR
    102102#                    |
    103103#                 -------
    104104#                 |     |
    105 #                1.0   1.1
     105#                1.0   1.1                           PBROOTDIR
    106106#                       |
    107107#               ----------------------------------
     
    123123if (not defined $ENV{'PBDEFDIR'}) {
    124124    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");
    127         pb_log(0,"         if you want to use another directory\n");
     125        pb_log(1,"WARNING: no pbdefdir defined, using /var/cache\n");
     126        pb_log(1,"         Please create a pbdefdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
     127        pb_log(1,"         if you want to use another directory\n");
    128128        $ENV{'PBDEFDIR'} = "/var/cache";
    129129    } else {
     
    182182#
    183183# The following part is only useful when in cms2build
    184 # In VMs/VEs we want to skip that by providing a good PBCONF env var.
     184# In VMs/VEs we want to skip that by providing a good PBCONFDIR env var.
    185185# return values in that case are useless
    186186#
    187 return if (defined $ENV{'PBCONF'});
     187return if (defined $ENV{'PBCONFDIR'});
    188188
    189189#
    190190# Check pbconf cms compliance
    191191#
    192 pb_cms_compliant("pbconfdir",'PBCONF',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf",$pbconf{$ENV{'PBPROJ'}},$pbinit);
    193 
    194 # Check where is our PBROOT (release tag name can't be guessed the first time)
    195 #
    196 if (not defined $ENV{'PBROOT'}) {
     192pb_cms_compliant("pbconfdir",'PBCONFDIR',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf",$pbconf{$ENV{'PBPROJ'}},$pbinit);
     193
     194# Check where is our PBROOTDIR (release tag name can't be guessed the first time)
     195#
     196if (not defined $ENV{'PBROOTDIR'}) {
    197197    if (! -f ("$ENV{'PBDESTDIR'}/pbrc")) {
    198         opendir(DIR,$ENV{'PBCONF'}) || die "Unable to open directory $ENV{'PBCONF'}: $!";
     198        opendir(DIR,$ENV{'PBCONFDIR'}) || die "Unable to open directory $ENV{'PBCONFDIR'}: $!";
    199199        my $maxmtime = 0;
    200200        foreach my $d (readdir(DIR)) {
    201201            pb_log(3,"Looking at \'$d\'...");
    202202            next if ($d =~ /^\./);
    203             next if (! -d "$ENV{'PBCONF'}/$d");
    204             my $s = stat("$ENV{'PBCONF'}/$d");
     203            next if (! -d "$ENV{'PBCONFDIR'}/$d");
     204            my $s = stat("$ENV{'PBCONFDIR'}/$d");
    205205            next if (not defined $s);
    206206            pb_log(3,"KEEP\n");
     
    208208            pb_log(2," $s->mtime\n");
    209209            if ($s->mtime > $maxmtime) {
    210                 $ENV{'PBROOT'} = "$ENV{'PBCONF'}/$d";
     210                $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}/$d";
    211211                $maxmtime = $s->mtime;
    212212            }
    213213        }
    214214        closedir(DIR);
    215         die "No directory found under $ENV{'PBCONF'}" if (not defined $ENV{'PBROOT'});
    216         pb_log(0,"WARNING: no pbroot defined, using $ENV{'PBROOT'}\n");
    217         pb_log(0,"         Please use -r release if you want to use another release\n");
     215        die "No directory found under $ENV{'PBCONFDIR'}" if (not defined $ENV{'PBROOTDIR'});
     216        pb_log(1,"WARNING: no pbroot defined, using $ENV{'PBROOTDIR'}\n");
     217        pb_log(1,"         Please use -r release if you want to use another release\n");
    218218    } else {
    219219        my ($pbroot) = pb_conf_read_if("$ENV{'PBDESTDIR'}/pbrc","pbroot");
    220220        # That's always the environment variable that will be used
    221221        die "Please remove inconsistent $ENV{'PBDESTDIR'}/pbrc" if ((not defined $pbroot) || (not defined $pbroot->{$ENV{'PBPROJ'}}));
    222         $ENV{'PBROOT'} = $pbroot->{$ENV{'PBPROJ'}};
     222        $ENV{'PBROOTDIR'} = $pbroot->{$ENV{'PBPROJ'}};
    223223    }
    224224} else {
    225225    # transform in full path if relative
    226     $ENV{'PBROOT'} = "$ENV{'PBCONF'}/$ENV{'PBROOT'}" if ($ENV{'PBROOT'} !~ /^\//);
    227     die "$ENV{'PBROOT'} is not a directory" if (not -d $ENV{'PBROOT'});
     226    $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}/$ENV{'PBROOTDIR'}" if ($ENV{'PBROOTDIR'} !~ /^\//);
     227    die "$ENV{'PBROOTDIR'} is not a directory" if (not -d $ENV{'PBROOTDIR'});
    228228}
    229229
     
    234234my %supfiles = ();
    235235
    236 if ((-f "$ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb") and (not defined $pbinit)) {
     236if ((-f "$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb") and (not defined $pbinit)) {
    237237    # List of pkg to build by default (mandatory)
    238238    my ($defpkgdir,$pbpackager) = pb_conf_get("defpkgdir","pbpackager");
     
    260260            $ENV{'PBVER'}=$pkgv->{$ENV{'PBPROJ'}};
    261261        } else {
    262             die "No projver found in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb";
    263         }
    264     }
    265     die "Invalid version name $ENV{'PBVER'} in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb" if (($ENV{'PBVER'} !~ /[0-9.]+/) && (not defined $version) && ($ENV{'PBVER'} =~ /$version{$ENV{'PBPROJ'}}/));
     262            die "No projver found in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
     263        }
     264    }
     265    die "Invalid version name $ENV{'PBVER'} in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb" if (($ENV{'PBVER'} !~ /[0-9.]+/) && (not defined $version) && ($ENV{'PBVER'} =~ /$version{$ENV{'PBPROJ'}}/));
    266266   
    267267    if (not defined $ENV{'PBTAG'}) {
     
    269269            $ENV{'PBTAG'}=$pkgt->{$ENV{'PBPROJ'}};
    270270        } else {
    271             die "No projtag found in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb";
    272         }
    273     }
    274     die "Invalid tag name $ENV{'PBTAG'} in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb" if ($ENV{'PBTAG'} !~ /[0-9.]+/);
     271            die "No projtag found in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
     272        }
     273    }
     274    die "Invalid tag name $ENV{'PBTAG'} in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb" if ($ENV{'PBTAG'} !~ /[0-9.]+/);
    275275
    276276
     
    279279            $ENV{'PBPACKAGER'}=$pbpackager->{$ENV{'PBPROJ'}};
    280280        } else {
    281             die "No pbpackager found in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb";
     281            die "No pbpackager found in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
    282282        }
    283283    }
     
    288288        @pkgs = ("pkg1") if (not @pkgs);
    289289
    290         open(CONF,"> $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb") || die "Unable to create $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb";
     290        open(CONF,"> $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb") || die "Unable to create $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
    291291        print CONF << "EOF";
    292292#
     
    393393        }
    394394        close(CONF);
    395         pb_mkdir_p("$ENV{'PBROOT'}/pbfilter") || die "Unable to create $ENV{'PBROOT'}/pbfilter";
    396         open(CONF,"> $ENV{'PBROOT'}/pbfilter/all.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/all.pbf";
     395        pb_mkdir_p("$ENV{'PBROOTDIR'}/pbfilter") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter";
     396        open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/all.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/all.pbf";
    397397        print CONF << "EOF";
    398398#
     
    432432EOF
    433433        close(CONF);
    434         open(CONF,"> $ENV{'PBROOT'}/pbfilter/rpm.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/rpm.pbf";
     434        open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/rpm.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/rpm.pbf";
    435435        print CONF << "EOF";
    436436#
     
    459459EOF
    460460        close(CONF);
    461         open(CONF,"> $ENV{'PBROOT'}/pbfilter/deb.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/deb.pbf";
     461        open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/deb.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/deb.pbf";
    462462        print CONF << "EOF";
    463463#
     
    496496EOF
    497497        close(CONF);
    498         open(CONF,"> $ENV{'PBROOT'}/pbfilter/md.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/md.pbf";
     498        open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/md.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/md.pbf";
    499499        print CONF << "EOF";
    500500# Specific group for Mandriva for $ENV{'PBPROJ'}
     
    508508EOF
    509509        close(CONF);
    510         open(CONF,"> $ENV{'PBROOT'}/pbfilter/novell.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/novell.pbf";
     510        open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/novell.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/novell.pbf";
    511511        print CONF << "EOF";
    512512# Specific group for SuSE for $ENV{'PBPROJ'}
     
    521521        close(CONF);
    522522        foreach my $pp (@pkgs) {
    523             pb_mkdir_p("$ENV{'PBROOT'}/$pp/deb") || die "Unable to create $ENV{'PBROOT'}/$pp/deb";
    524             open(CONF,"> $ENV{'PBROOT'}/$pp/deb/control") || die "Unable to create $ENV{'PBROOT'}/$pp/deb/control";
     523            pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/deb") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb";
     524            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/control") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/control";
    525525            print CONF << "EOF";
    526526Source: PBPKG
     
    545545EOF
    546546            close(CONF);
    547             open(CONF,"> $ENV{'PBROOT'}/$pp/deb/copyright") || die "Unable to create $ENV{'PBROOT'}/$pp/deb/copyright";
     547            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/copyright") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/copyright";
    548548            print CONF << "EOF";
    549549This package is debianized by PBPACKAGER
     
    576576EOF
    577577            close(CONF);
    578             open(CONF,"> $ENV{'PBROOT'}/$pp/deb/changelog") || die "Unable to create $ENV{'PBROOT'}/$pp/deb/changelog";
     578            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/changelog") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/changelog";
    579579            print CONF << "EOF";
    580580PBLOG
    581581EOF
    582582            close(CONF);
    583             open(CONF,"> $ENV{'PBROOT'}/$pp/deb/compat") || die "Unable to create $ENV{'PBROOT'}/$pp/deb/compat";
     583            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/compat") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/compat";
    584584            print CONF << "EOF";
    5855854
    586586EOF
    587587            close(CONF);
    588             open(CONF,"> $ENV{'PBROOT'}/$pp/deb/pkg1.dirs") || die "Unable to create $ENV{'PBROOT'}/$pp/deb/$pp.dirs";
     588            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/pkg1.dirs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs";
    589589            print CONF << "EOF";
    590590EOF
    591591            close(CONF);
    592             open(CONF,"> $ENV{'PBROOT'}/$pp/deb/$pp.docs") || die "Unable to create $ENV{'PBROOT'}/$pp/deb/$pp.docs";
     592            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/$pp.docs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.docs";
    593593            print CONF << "EOF";
    594594INSTALL
     
    599599EOF
    600600            close(CONF);
    601             open(CONF,"> $ENV{'PBROOT'}/$pp/deb/rules") || die "Unable to create $ENV{'PBROOT'}/$pp/deb/rules";
     601            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/rules") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/rules";
    602602            print CONF << 'EOF';
    603603#!/usr/bin/make -f
     
    736736EOF
    737737            close(CONF);
    738             pb_mkdir_p("$ENV{'PBROOT'}/$pp/rpm") || die "Unable to create $ENV{'PBROOT'}/$pp/rpm";
    739             open(CONF,"> $ENV{'PBROOT'}/$pp/rpm/$pp.spec") || die "Unable to create $ENV{'PBROOT'}/$pp/rpm/$pp.spec";
     738            pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/rpm") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/rpm";
     739            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/rpm/$pp.spec") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/rpm/$pp.spec";
    740740            print CONF << 'EOF';
    741741#
     
    786786EOF
    787787            close(CONF);
    788             pb_mkdir_p("$ENV{'PBROOT'}/$pp/pbfilter") || die "Unable to create $ENV{'PBROOT'}/$pp/pbfilter";
     788            pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/pbfilter") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/pbfilter";
    789789
    790790            pb_log(0,"\nDo not to forget to commit the pbconf directory in your CMS if needed\n");
    791791        }
    792792    } else {
    793         die "Unable to open $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb";
     793        die "Unable to open $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
    794794    }
    795795}
     
    874874my @ptr2 = ();
    875875@ptr1 = pb_conf_read_if("$ENV{'PBETC'}", @param) if (defined $ENV{'PBETC'});
    876 @ptr2 = pb_conf_read_if("$ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb", @param) if ((defined $ENV{'PBROOT'}) and (defined $ENV{'PBPROJ'}));
     876@ptr2 = pb_conf_read_if("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb", @param) if ((defined $ENV{'PBROOTDIR'}) and (defined $ENV{'PBPROJ'}));
    877877
    878878my $p1;
     
    989989sub pb_cms_init {
    990990
    991 my $scheme = shift || undef;
     991my $pbinit = shift || undef;
     992
     993my ($pburl) = pb_conf_get("pburl");
     994pb_log(2,"DEBUG: Project URL of $ENV{'PBPROJ'}: $pburl->{$ENV{'PBPROJ'}}\n");
     995my ($scheme, $account, $host, $port, $path) = pb_get_uri($pburl->{$ENV{'PBPROJ'}});
     996
     997my ($pbprojdir) = pb_conf_get_if("pbprojdir");
     998
     999if ((defined $pbprojdir) && (defined $pbprojdir->{$ENV{'PBPROJ'}})) {
     1000    $ENV{'PBPROJDIR'} = $pbprojdir->{$ENV{'PBPROJ'}};
     1001} else {
     1002    $ENV{'PBPROJDIR'} = "$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}";
     1003}
     1004
     1005# Computing the default dir for PBDIR.
     1006# what we have is PBPROJDIR so work from that.
     1007# Tree identical between PBCONFDIR and PBROOTDIR on one side and
     1008# PBPROJDIR and PBDIR on the other side.
     1009
     1010my $tmp = $ENV{'PBROOTDIR'};
     1011$tmp =~ s|^$ENV{'PBCONFDIR'}||;
     1012
     1013#
     1014# Check project cms compliance
     1015#
     1016pb_cms_compliant(undef,'PBDIR',"$ENV{'PBPROJDIR'}/$tmp",$pburl->{$ENV{'PBPROJ'}},$pbinit);
    9921017
    9931018if ($scheme =~ /^svn/) {
    9941019    # svnversion more precise than svn info
    995     my $tmp = `(cd "$ENV{'PBDIR'}" ; svnversion .)`;
     1020    $tmp = `(cd "$ENV{'PBDIR'}" ; svnversion .)`;
    9961021    chomp($tmp);
    9971022    $ENV{'PBREVISION'}=$tmp;
     
    10021027} elsif ($scheme =~ /^cvs/) {
    10031028    # Way too slow
    1004     #$ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; cvs rannotate  -f . 2>&1 | awk '{print \$1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`;
     1029    #$ENV{'PBREVISION'}=`(cd "$ENV{'PBROOTDIR'}" ; cvs rannotate  -f . 2>&1 | awk '{print \$1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`;
    10051030    #chomp($ENV{'PBREVISION'});
    10061031    $ENV{'PBREVISION'}="cvs";
     
    10101035    die "cms $scheme unknown";
    10111036}
     1037
     1038return($scheme,$pburl->{$ENV{'PBPROJ'}});
    10121039}
    10131040
     
    10341061    } else {
    10351062        $tmp = "$destdir/".basename($source);
    1036         pb_mkdir_p($tmp);
    10371063    }
    10381064    pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp");
     
    10961122    if (-d $source) {
    10971123        $tmp1 = $source;
    1098         $tmp1 =~ s|$ENV{'PBROOT'}/||;
     1124        $tmp1 =~ s|$ENV{'PBROOTDIR'}/||;
    10991125        $tmp1 =~ s|$ENV{'PBDIR'}/||;
    11001126    } else {
    11011127        $tmp1 = dirname($source);
    1102         $tmp1 =~ s|$ENV{'PBROOT'}/||;
     1128        $tmp1 =~ s|$ENV{'PBROOTDIR'}/||;
    11031129        $tmp1 =~ s|$ENV{'PBDIR'}/||;
    11041130        $tmp1 = $tmp1."/".basename($source);
     
    12871313
    12881314if ($scheme =~ /^svn/) {
    1289     open(PIPE,"svn diff $ENV{'PBROOT'} |") || die "Unable to get svn diff from $ENV{'PBROOT'}";
     1315    open(PIPE,"svn diff $ENV{'PBROOTDIR'} |") || die "Unable to get svn diff from $ENV{'PBROOTDIR'}";
    12901316    my $l = 0;
    12911317    while (<PIPE>) {
     
    13191345
    13201346# Global filter files first, then package specificities
    1321 if (-d "$ENV{'PBROOT'}/pbfilter") {
    1322     $mfile00 = "$ENV{'PBROOT'}/pbfilter/all.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/all.pbf");
    1323     $mfile0 = "$ENV{'PBROOT'}/pbfilter/$dtype.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$dtype.pbf");
    1324     $mfile1 = "$ENV{'PBROOT'}/pbfilter/$dfam.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$dfam.pbf");
    1325     $mfile2 = "$ENV{'PBROOT'}/pbfilter/$ddir.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$ddir.pbf");
    1326     $mfile3 = "$ENV{'PBROOT'}/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$ddir-$dver.pbf");
     1347if (-d "$ENV{'PBROOTDIR'}/pbfilter") {
     1348    $mfile00 = "$ENV{'PBROOTDIR'}/pbfilter/all.pbf" if (-f "$ENV{'PBROOTDIR'}/pbfilter/all.pbf");
     1349    $mfile0 = "$ENV{'PBROOTDIR'}/pbfilter/$dtype.pbf" if (-f "$ENV{'PBROOTDIR'}/pbfilter/$dtype.pbf");
     1350    $mfile1 = "$ENV{'PBROOTDIR'}/pbfilter/$dfam.pbf" if (-f "$ENV{'PBROOTDIR'}/pbfilter/$dfam.pbf");
     1351    $mfile2 = "$ENV{'PBROOTDIR'}/pbfilter/$ddir.pbf" if (-f "$ENV{'PBROOTDIR'}/pbfilter/$ddir.pbf");
     1352    $mfile3 = "$ENV{'PBROOTDIR'}/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBROOTDIR'}/pbfilter/$ddir-$dver.pbf");
    13271353
    13281354    push @ffiles,$mfile00 if (defined $mfile00);
     
    13331359}
    13341360
    1335 if (-d "$ENV{'PBROOT'}/$pbpkg/pbfilter") {
    1336     $ffile00 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/all.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/all.pbf");
    1337     $ffile0 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dtype.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dtype.pbf");
    1338     $ffile1 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dfam.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dfam.pbf");
    1339     $ffile2 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir.pbf");
    1340     $ffile3 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir-$dver.pbf");
     1361if (-d "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter") {
     1362    $ffile00 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/all.pbf" if (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/all.pbf");
     1363    $ffile0 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$dtype.pbf" if (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$dtype.pbf");
     1364    $ffile1 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$dfam.pbf" if (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$dfam.pbf");
     1365    $ffile2 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$ddir.pbf" if (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$ddir.pbf");
     1366    $ffile3 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$ddir-$dver.pbf");
    13411367
    13421368    push @ffiles,$ffile00 if (defined $ffile00);
     
    15141540}
    15151541
     1542#
     1543# Check pbconf/project cms compliance
     1544#
    15161545sub pb_cms_compliant {
    15171546
     
    15211550my $uri = shift;
    15221551my $pbinit = shift;
    1523 #
    1524 # Check pbconf/project cms compliance
    1525 #
    1526 
    1527 my ($pdir) = pb_conf_get_if($param);
    1528 my %pdir = %$pdir;
    1529 
    1530 if ((defined $pdir) && (defined $pdir{$ENV{'PBPROJ'}})) {
     1552my %pdir;
     1553
     1554my ($pdir) = pb_conf_get_if($param) if (defined $param);
     1555if (defined $pdir) {
     1556    %pdir = %$pdir;
     1557}
     1558
     1559
     1560if ((defined $pdir) && (%pdir) && (defined $pdir{$ENV{'PBPROJ'}})) {
    15311561    # That's always the environment variable that will be used
    15321562    $ENV{$envar} = $pdir{$ENV{'PBPROJ'}};
    15331563} else {
    1534     pb_log(0,"WARNING: no $param defined, using $defdir\n");
    1535     pb_log(0,"         Please create a $param reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
    1536     pb_log(0,"         if you want to use another directory\n");
     1564    if (defined $param) {
     1565        pb_log(1,"WARNING: no $param defined, using $defdir\n");
     1566        pb_log(1,"         Please create a $param reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
     1567        pb_log(1,"         if you want to use another directory\n");
     1568    }
    15371569    $ENV{$envar} = "$defdir";
    15381570}
Note: See TracChangeset for help on using the changeset viewer.