Changeset 339 in ProjectBuilder
- Timestamp:
- Mar 29, 2008, 6:11:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/lib/ProjectBuilder/Base.pm
r333 r339 32 32 33 33 our @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);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_get_uri pb_cms_get_uri $debug $LOG); 35 35 36 36 $ENV{'PBETC'} = "$ENV{'HOME'}/.pbrc"; … … 66 66 $proj = (keys %pbconf)[0]; 67 67 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"); 72 72 } 73 73 } … … 91 91 # ------------------------ -------------------- 92 92 # | | | | 93 # pbproj1 pbproj2 PBPROJ pbproj1 pbproj2 93 # pbproj1 pbproj2 PBPROJ pbproj1 pbproj2 PBPROJDIR 94 94 # | | 95 95 # --------------------------------------------- ---------- 96 96 # * * * | | | * * 97 # tag dev pbconf ... build delivery PBCONF 97 # tag dev pbconf ... build delivery PBCONFDIR dev tag 98 98 # | | | PBDESTDIR | 99 99 # --- ------ pbrc PBBUILDDIR ------- 100 100 # | | | | | 101 # 1.1 dev tag PBROOT1.0 1.1 PBDIR101 # 1.1 dev tag 1.0 1.1 PBDIR 102 102 # | 103 103 # ------- 104 104 # | | 105 # 1.0 1.1 105 # 1.0 1.1 PBROOTDIR 106 106 # | 107 107 # ---------------------------------- … … 123 123 if (not defined $ENV{'PBDEFDIR'}) { 124 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");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"); 128 128 $ENV{'PBDEFDIR'} = "/var/cache"; 129 129 } else { … … 182 182 # 183 183 # 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. 185 185 # return values in that case are useless 186 186 # 187 return if (defined $ENV{'PBCONF '});187 return if (defined $ENV{'PBCONFDIR'}); 188 188 189 189 # 190 190 # Check pbconf cms compliance 191 191 # 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 '}) {192 pb_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 # 196 if (not defined $ENV{'PBROOTDIR'}) { 197 197 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'}: $!"; 199 199 my $maxmtime = 0; 200 200 foreach my $d (readdir(DIR)) { 201 201 pb_log(3,"Looking at \'$d\'..."); 202 202 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"); 205 205 next if (not defined $s); 206 206 pb_log(3,"KEEP\n"); … … 208 208 pb_log(2," $s->mtime\n"); 209 209 if ($s->mtime > $maxmtime) { 210 $ENV{'PBROOT '} = "$ENV{'PBCONF'}/$d";210 $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}/$d"; 211 211 $maxmtime = $s->mtime; 212 212 } 213 213 } 214 214 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"); 218 218 } else { 219 219 my ($pbroot) = pb_conf_read_if("$ENV{'PBDESTDIR'}/pbrc","pbroot"); 220 220 # That's always the environment variable that will be used 221 221 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'}}; 223 223 } 224 224 } else { 225 225 # 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'}); 228 228 } 229 229 … … 234 234 my %supfiles = (); 235 235 236 if ((-f "$ENV{'PBROOT '}/$ENV{'PBPROJ'}.pb") and (not defined $pbinit)) {236 if ((-f "$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb") and (not defined $pbinit)) { 237 237 # List of pkg to build by default (mandatory) 238 238 my ($defpkgdir,$pbpackager) = pb_conf_get("defpkgdir","pbpackager"); … … 260 260 $ENV{'PBVER'}=$pkgv->{$ENV{'PBPROJ'}}; 261 261 } 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'}}/)); 266 266 267 267 if (not defined $ENV{'PBTAG'}) { … … 269 269 $ENV{'PBTAG'}=$pkgt->{$ENV{'PBPROJ'}}; 270 270 } 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.]+/); 275 275 276 276 … … 279 279 $ENV{'PBPACKAGER'}=$pbpackager->{$ENV{'PBPROJ'}}; 280 280 } else { 281 die "No pbpackager found in $ENV{'PBROOT '}/$ENV{'PBPROJ'}.pb";281 die "No pbpackager found in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb"; 282 282 } 283 283 } … … 288 288 @pkgs = ("pkg1") if (not @pkgs); 289 289 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"; 291 291 print CONF << "EOF"; 292 292 # … … 393 393 } 394 394 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"; 397 397 print CONF << "EOF"; 398 398 # … … 432 432 EOF 433 433 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"; 435 435 print CONF << "EOF"; 436 436 # … … 459 459 EOF 460 460 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"; 462 462 print CONF << "EOF"; 463 463 # … … 496 496 EOF 497 497 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"; 499 499 print CONF << "EOF"; 500 500 # Specific group for Mandriva for $ENV{'PBPROJ'} … … 508 508 EOF 509 509 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"; 511 511 print CONF << "EOF"; 512 512 # Specific group for SuSE for $ENV{'PBPROJ'} … … 521 521 close(CONF); 522 522 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"; 525 525 print CONF << "EOF"; 526 526 Source: PBPKG … … 545 545 EOF 546 546 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"; 548 548 print CONF << "EOF"; 549 549 This package is debianized by PBPACKAGER … … 576 576 EOF 577 577 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"; 579 579 print CONF << "EOF"; 580 580 PBLOG 581 581 EOF 582 582 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"; 584 584 print CONF << "EOF"; 585 585 4 586 586 EOF 587 587 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"; 589 589 print CONF << "EOF"; 590 590 EOF 591 591 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"; 593 593 print CONF << "EOF"; 594 594 INSTALL … … 599 599 EOF 600 600 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"; 602 602 print CONF << 'EOF'; 603 603 #!/usr/bin/make -f … … 736 736 EOF 737 737 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"; 740 740 print CONF << 'EOF'; 741 741 # … … 786 786 EOF 787 787 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"; 789 789 790 790 pb_log(0,"\nDo not to forget to commit the pbconf directory in your CMS if needed\n"); 791 791 } 792 792 } else { 793 die "Unable to open $ENV{'PBROOT '}/$ENV{'PBPROJ'}.pb";793 die "Unable to open $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb"; 794 794 } 795 795 } … … 874 874 my @ptr2 = (); 875 875 @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'})); 877 877 878 878 my $p1; … … 989 989 sub pb_cms_init { 990 990 991 my $scheme = shift || undef; 991 my $pbinit = shift || undef; 992 993 my ($pburl) = pb_conf_get("pburl"); 994 pb_log(2,"DEBUG: Project URL of $ENV{'PBPROJ'}: $pburl->{$ENV{'PBPROJ'}}\n"); 995 my ($scheme, $account, $host, $port, $path) = pb_get_uri($pburl->{$ENV{'PBPROJ'}}); 996 997 my ($pbprojdir) = pb_conf_get_if("pbprojdir"); 998 999 if ((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 1010 my $tmp = $ENV{'PBROOTDIR'}; 1011 $tmp =~ s|^$ENV{'PBCONFDIR'}||; 1012 1013 # 1014 # Check project cms compliance 1015 # 1016 pb_cms_compliant(undef,'PBDIR',"$ENV{'PBPROJDIR'}/$tmp",$pburl->{$ENV{'PBPROJ'}},$pbinit); 992 1017 993 1018 if ($scheme =~ /^svn/) { 994 1019 # svnversion more precise than svn info 995 my$tmp = `(cd "$ENV{'PBDIR'}" ; svnversion .)`;1020 $tmp = `(cd "$ENV{'PBDIR'}" ; svnversion .)`; 996 1021 chomp($tmp); 997 1022 $ENV{'PBREVISION'}=$tmp; … … 1002 1027 } elsif ($scheme =~ /^cvs/) { 1003 1028 # 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)`; 1005 1030 #chomp($ENV{'PBREVISION'}); 1006 1031 $ENV{'PBREVISION'}="cvs"; … … 1010 1035 die "cms $scheme unknown"; 1011 1036 } 1037 1038 return($scheme,$pburl->{$ENV{'PBPROJ'}}); 1012 1039 } 1013 1040 … … 1034 1061 } else { 1035 1062 $tmp = "$destdir/".basename($source); 1036 pb_mkdir_p($tmp);1037 1063 } 1038 1064 pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp"); … … 1096 1122 if (-d $source) { 1097 1123 $tmp1 = $source; 1098 $tmp1 =~ s|$ENV{'PBROOT '}/||;1124 $tmp1 =~ s|$ENV{'PBROOTDIR'}/||; 1099 1125 $tmp1 =~ s|$ENV{'PBDIR'}/||; 1100 1126 } else { 1101 1127 $tmp1 = dirname($source); 1102 $tmp1 =~ s|$ENV{'PBROOT '}/||;1128 $tmp1 =~ s|$ENV{'PBROOTDIR'}/||; 1103 1129 $tmp1 =~ s|$ENV{'PBDIR'}/||; 1104 1130 $tmp1 = $tmp1."/".basename($source); … … 1287 1313 1288 1314 if ($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'}"; 1290 1316 my $l = 0; 1291 1317 while (<PIPE>) { … … 1319 1345 1320 1346 # 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");1347 if (-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"); 1327 1353 1328 1354 push @ffiles,$mfile00 if (defined $mfile00); … … 1333 1359 } 1334 1360 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");1361 if (-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"); 1341 1367 1342 1368 push @ffiles,$ffile00 if (defined $ffile00); … … 1514 1540 } 1515 1541 1542 # 1543 # Check pbconf/project cms compliance 1544 # 1516 1545 sub pb_cms_compliant { 1517 1546 … … 1521 1550 my $uri = shift; 1522 1551 my $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'}})) { 1552 my %pdir; 1553 1554 my ($pdir) = pb_conf_get_if($param) if (defined $param); 1555 if (defined $pdir) { 1556 %pdir = %$pdir; 1557 } 1558 1559 1560 if ((defined $pdir) && (%pdir) && (defined $pdir{$ENV{'PBPROJ'}})) { 1531 1561 # That's always the environment variable that will be used 1532 1562 $ENV{$envar} = $pdir{$ENV{'PBPROJ'}}; 1533 1563 } 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 } 1537 1569 $ENV{$envar} = "$defdir"; 1538 1570 }
Note:
See TracChangeset
for help on using the changeset viewer.