- Timestamp:
- Feb 9, 2008, 9:29:56 AM (17 years ago)
- Location:
- devel/pb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r313 r314 99 99 die pb_syntax() if (not defined $action); 100 100 101 my ($ pbrc, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir);101 my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir); 102 102 my $pbinit = undef; 103 103 $pbinit = 1 if ($action =~ /^newproj$/); … … 106 106 # And get global params 107 107 if (defined $opts{'p'}) { 108 ($debug,$LOG, $ pbrc, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir)108 ($debug,$LOG, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir) 109 109 = pb_env_init($opts{'p'},$pbinit); 110 110 } else { 111 ($debug,$LOG, $ pbrc, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir)111 ($debug,$LOG, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir) 112 112 = pb_env_init(undef,$pbinit); 113 113 } … … 309 309 } 310 310 print $LOG "Build files generated for ".join(',',@found)."\n"; 311 print $LOG "No Build files found for ".join(',',@notfound)."\n" ;311 print $LOG "No Build files found for ".join(',',@notfound)."\n" if (@notfound); 312 312 } 313 313 # Get the generic filter (all.pbf) and … … 340 340 print $LOG "Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n" if ($debug >= 0); 341 341 342 # Keep track of what is generated for default 343 open(LAST,"> $pbrc->{$ENV{'PBPROJ'}}") || die "Unable to create $pbrc->{$ENV{'PBPROJ'}}"; 344 print LAST "pbroot $pbprojver-$pbprojtag = $ENV{'PBROOT'}\n"; 342 # Keep track of what is generated by default 343 open(LAST,"> $ENV{'PBDESTDIR'}/pbrc") || die "Unable to create $ENV{'PBDESTDIR'}/pbrc"; 344 #print LAST "pbroot $pbprojver-$pbprojtag = $ENV{'PBROOT'}\n"; 345 # Why not use pbproj ? 346 print LAST "pbroot $ENV{'PBPROJ'} = $ENV{'PBROOT'}\n"; 345 347 close(LAST); 346 348 347 349 # Keep track of per package version 348 if (! -f "$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") { 349 open(PKG,">$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") || die "Unable to create $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb"; 350 print PKG "# Empty\n"; 351 close(PKG); 352 } 353 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg"); 350 my ($pkg) = pb_conf_read_if("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg"); 354 351 $pkg = { } if (not defined $pkg); 355 352 if ((not defined $pkg->{$pbpkg}) || ($pkg->{$pbpkg} ne "$pbver-$pbtag")) { … … 660 657 # Gather all required files to send them to the VM 661 658 # and launch the build thourgh pbscript 662 pb_send2ssh("Script","$v",$vmexist,$vmpid,"vmhost","vmlogin"," pbrc","vmport","vmtmout");659 pb_send2ssh("Script","$v",$vmexist,$vmpid,"vmhost","vmlogin","$ENV{'PBDESTDIR'}/pbrc","vmport","vmtmout"); 663 660 664 661 } … … 859 856 # Gather all required files to send them to the VM 860 857 # and launch the build thourgh pbscript 861 pb_send2ssh("VMs","$v",$vmexist,$vmpid,"vmhost","vmlogin"," pbrc","vmport","vmtmout");858 pb_send2ssh("VMs","$v",$vmexist,$vmpid,"vmhost","vmlogin","$ENV{'PBDESTDIR'}/pbrc","vmport","vmtmout"); 862 859 } 863 860 } … … 873 870 my $res = pb_cms_isdiff($cms); 874 871 die "You need to have no differences before creating a new version" if ($res != 0); 875 my $cmsurl = pb_cms_getinfo($cms );872 my $cmsurl = pb_cms_getinfo($cms,$ENV{'PBROOT'}); 876 873 my $newurl = dirname($cmsurl)."/$newver"; 877 874 pb_cms_copy($cms,$cmsurl,$newurl); -
devel/pb/lib/ProjectBuilder/Base.pm
r313 r314 67 67 # Detect the root dir for hosting all the content generated with pb 68 68 # 69 my ($pbroot) = pb_conf_get_if("pbroot"); 70 my %pbroot = %$pbroot; 71 72 if (not defined $ENV{'PBROOT'}) { 73 if (not defined ($pbroot{$ENV{'PBPROJ'}})) { 74 print $LOG "WARNING: no pbroot defined, using /var/cache\n"; 75 print $LOG "Please create a pbroot reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\nif you want to use another directory\n"; 69 # Tree will look like this: 70 # 71 # maint pbdir dev dir (optional) 72 # | | 73 # ------------------------ -------------------- 74 # | | | | 75 # pbproj1 pbproj2 pbproj1 pbproj2 76 # | | 77 # --------------------------------------------- ---------- 78 # * * | | | | * * 79 # 1.0 dev pbconf ... build delivery 1.0 dev 80 # | | | 81 # ------ pbrc 82 # | | 83 # 1.0 dev 84 # | 85 # ---------------------------------- 86 # | | | | 87 # pkg1 pbproj1.pb pbfilter pbcl 88 # | 89 # ----------------- 90 # | | | 91 # rpm deb pbfilter 92 # 93 # 94 # (*) By default, if no relocation in .pbrc, dev dir is taken in the maint pbdir (when appropriate) 95 # Names under a pbproj and the corresponding pbconf should be similar 96 # 97 98 my ($pbdir) = pb_conf_get_if("pbdir"); 99 my %pbdir = %$pbdir; 100 101 if (not defined $ENV{'PBDIR'}) { 102 if (not defined ($pbdir{$ENV{'PBPROJ'}})) { 103 print $LOG "WARNING: no pbdir defined, using /var/cache\n"; 104 print $LOG "Please create a pbdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\nif you want to use another directory\n"; 76 105 } 77 106 # That's always the environment variable that will be used 78 $ENV{'PB ROOT'} = $pbroot{$ENV{'PBPROJ'}};107 $ENV{'PBDIR'} = $pbdir{$ENV{'PBPROJ'}}; 79 108 } 80 109 # Expand potential env variable in it 81 eval { $ENV{'PB ROOT'} =~ s/(\$ENV.+\})/$1/eeg };110 eval { $ENV{'PBDIR'} =~ s/(\$ENV.+\})/$1/eeg }; 82 111 83 112 # 84 113 # Set delivery directory 85 114 # 86 $ENV{'PBDESTDIR'}="$ENV{'PB ROOT'}/$ENV{'PBPROJ'}/delivery";115 $ENV{'PBDESTDIR'}="$ENV{'PBDIR'}/$ENV{'PBPROJ'}/delivery"; 87 116 88 117 # … … 109 138 # Set build directory 110 139 # 111 $ENV{'PBBUILDDIR'}="$ENV{'PB ROOT'}/$ENV{'PBPROJ'}/build";140 $ENV{'PBBUILDDIR'}="$ENV{'PBDIR'}/$ENV{'PBPROJ'}/build"; 112 141 if (! -d "$ENV{'PBBUILDDIR'}") { 113 142 pb_mkdir_p($ENV{'PBBUILDDIR'}) || die "Unable to recursively create $ENV{'PBBUILDDIR'}"; … … 122 151 $ENV{'PBTMP'} = tempdir( "pb.XXXXXXXXXX", DIR => $ENV{'TMPDIR'}, CLEANUP => 1 ); 123 152 124 # Not sure it'll still be needed125 #$pbrc{$ENV{'PBPROJ'}} = $topdir."/pbrc";126 127 153 # 128 154 # Check pbconf compliance 129 155 # 130 $ENV{'PBCONF'} = "$ENV{'PBROOT'}/$ENV{'PBPROJ'}/pbconf"; 131 if (not -d "$ENV{'PBCONF'}") { 132 pb_mkdir_p("$ENV{'PBCONF'}"); 133 } 134 135 136 if (defined $pbinit) { 137 print $LOG "Creating $ENV{'PBCONF'} directory\n"; 138 pb_mkdir_p("$ENV{'PBCONF'}"); 139 } 140 die "Project $ENV{'PBPROJ'} not Project-Builder compliant. Please populate $ENV{'PBCONF'}" if ( not -d "$ENV{'PBCONF'}"); 156 $ENV{'PBCONF'} = "$ENV{'PBDIR'}/$ENV{'PBPROJ'}/pbconf"; 157 158 my ($scheme, $account, $host, $port, $path) = pb_get_uri($pbconf{$ENV{'PBPROJ'}}); 159 my $cms = { $ENV{'PBPROJ'} => $scheme }; 160 161 if ((not -d "$ENV{'PBCONF'}") || (defined $pbinit)) { 162 pb_cms_checkout($cms,$pbconf{$ENV{'PBPROJ'}},$ENV{'PBCONF'}); 163 } else { 164 my $cmsurl = pb_cms_getinfo($cms,$ENV{'PBCONF'}); 165 if ($cmsurl !~ /^$scheme/) { 166 pb_rm_rf("$ENV{'PBCONF'}"); 167 pb_cms_checkout($cms,$pbconf{$ENV{'PBPROJ'}},$ENV{'PBCONF'}); 168 } elsif ($cmsurl ne $pbconf{$ENV{'PBPROJ'}}) { 169 # The local content doesn't correpond to the repository 170 print $LOG "ERROR: Inconsistency detected:\n"; 171 print $LOG "* $ENV{'PBCONF'} refers to $cmsurl but\n"; 172 print $LOG "* $ENV{'PBETC'} refers to $pbconf{$ENV{'PBPROJ'}}\n"; 173 die "Project $ENV{'PBPROJ'} is not Project-Builder compliant."; 174 } else { 175 # they match - do nothing - there may be local changes 176 } 177 } 178 179 # Check where is our PBROOT (release tag name can't be guessed the first time) 180 if (not defined $ENV{'PBROOT'}) { 181 if (! -f ("$ENV{'PBDESTDIR'}/pbrc")) { 182 opendir(DIR,$ENV{'PBCONF'}) || die "Unable to open directory $ENV{'PBCONF'}: $!"; 183 my maxmtime = 0; 184 foreach my $d (readdir(DIR)) { 185 next if ($d =~ /^\./); 186 next if (! -d $d); 187 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) 188 = stat($d); 189 # Keep the most recent 190 if ($mtime > $maxmtime) { 191 $ENV{'PBROOT'} = "$ENV{'PBCONF'}/$d"; 192 $maxmtime = $mtime; 193 } 194 } 195 closedir(DIR); 196 print $LOG "WARNING: no pbroot defined, using $ENV{'PBROOT'}\n"; 197 print $LOG "Please -r release if you want to use another release\n"; 198 } else { 199 my ($pbroot) = pb_conf_read_if("$ENV{'PBDESTDIR'}/pbrc","pbroot"); 200 # That's always the environment variable that will be used 201 $ENV{'PBROOT'} = $pbroot{$ENV{'PBPROJ'}}; 202 } 203 } else { 204 # transform in full path if relative 205 $ENV{'PBROOT'} = "$ENV{'PBCONF'}/$ENV{'PBROOT'}" if ($ENV{'PBROOT'} !~ |/|); 206 } 141 207 142 208 my %version = (); … … 146 212 my %supfiles = (); 147 213 148 if ((-f "$ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb") and (not defined $pbinit)) {214 if ((-f "$ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb") and (not defined $pbinit)) { 149 215 # List of pkg to build by default (mandatory) 150 216 my ($defpkgdir) = pb_conf_get("defpkgdir"); … … 159 225 print "DEBUG: filteredfiles: ".Dumper($filteredfiles)."\n" if ($debug >= 1); 160 226 print "DEBUG: supfiles: ".Dumper($supfiles)."\n" if ($debug >= 1); 161 die "Unable to find defpkgdir in $ENV{'PBCONF'}/$ENV{'PBPROJ'}.pb" if (not defined $defpkgdir);162 227 # Global 163 228 %defpkgdir = %$defpkgdir; … … 169 234 # Get global Version/Tag 170 235 # 171 172 236 if (not defined $ENV{'PBVER'}) { 173 237 if ((defined $pkgv) && (defined $pkgv->{$ENV{'PBPROJ'}})) { 174 238 $ENV{'PBVER'}=$pkgv->{$ENV{'PBPROJ'}}; 175 239 } else { 176 die "No projver found in $ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb";240 die "No projver found in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb"; 177 241 } 178 242 } 179 die "Invalid version name $ENV{'PBVER'} in $ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb" if (($ENV{'PBVER'} !~ /[0-9.]+/) && (not defined $version) && ($ENV{'PBVER'} =~ /$version{$ENV{'PBPROJ'}}/));243 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'}}/)); 180 244 181 245 if (not defined $ENV{'PBTAG'}) { … … 183 247 $ENV{'PBTAG'}=$pkgt->{$ENV{'PBPROJ'}}; 184 248 } else { 185 die "No projtag found in $ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb";249 die "No projtag found in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb"; 186 250 } 187 251 } 188 die "Invalid tag name $ENV{'PBTAG'} in $ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb" if ($ENV{'PBTAG'} !~ /[0-9.]+/);252 die "Invalid tag name $ENV{'PBTAG'} in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb" if ($ENV{'PBTAG'} !~ /[0-9.]+/); 189 253 } else { 190 254 if (defined $pbinit) { 191 open(CONF,"> $ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb") || die "Unable to create $ENV{'PBCONF'}/$ENV{'PBPROJ'}.pb";255 open(CONF,"> $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb") || die "Unable to create $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb"; 192 256 print CONF << "EOF"; 193 257 # … … 280 344 EOF 281 345 close(CONF); 282 pb_mkdir_p("$ENV{'PB CONF'}/pbfilter") || die "Unable to create $ENV{'PBCONF'}/pbfilter";283 open(CONF,"> $ENV{'PB CONF'}/pbfilter/all.pbf") || die "Unable to create $ENV{'PBCONF'}/pbfilter/all.pbf";346 pb_mkdir_p("$ENV{'PBROOT'}/pbfilter") || die "Unable to create $ENV{'PBROOT'}/pbfilter"; 347 open(CONF,"> $ENV{'PBROOT'}/pbfilter/all.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/all.pbf"; 284 348 print CONF << "EOF"; 285 349 # … … 319 383 EOF 320 384 close(CONF); 321 open(CONF,"> $ENV{'PB CONF'}/pbfilter/rpm.pbf") || die "Unable to create $ENV{'PBCONF'}/pbfilter/rpm.pbf";385 open(CONF,"> $ENV{'PBROOT'}/pbfilter/rpm.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/rpm.pbf"; 322 386 print CONF << "EOF"; 323 387 # … … 342 406 EOF 343 407 close(CONF); 344 open(CONF,"> $ENV{'PB CONF'}/pbfilter/deb.pbf") || die "Unable to create $ENV{'PBCONF'}/pbfilter/deb.pbf";408 open(CONF,"> $ENV{'PBROOT'}/pbfilter/deb.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/deb.pbf"; 345 409 print CONF << "EOF"; 346 410 # … … 375 439 EOF 376 440 close(CONF); 377 open(CONF,"> $ENV{'PB CONF'}/pbfilter/md.pbf") || die "Unable to create $ENV{'PBCONF'}/pbfilter/md.pbf";441 open(CONF,"> $ENV{'PBROOT'}/pbfilter/md.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/md.pbf"; 378 442 print CONF << "EOF"; 379 443 # Specific group for Mandriva for $ENV{'PBPROJ'} … … 381 445 EOF 382 446 close(CONF); 383 open(CONF,"> $ENV{'PB CONF'}/pbfilter/novell.pbf") || die "Unable to create $ENV{'PBCONF'}/pbfilter/novell.pbf";447 open(CONF,"> $ENV{'PBROOT'}/pbfilter/novell.pbf") || die "Unable to create $ENV{'PBROOT'}/pbfilter/novell.pbf"; 384 448 print CONF << "EOF"; 385 449 # Specific group for SuSE for $ENV{'PBPROJ'} … … 387 451 EOF 388 452 close(CONF); 389 pb_mkdir_p("$ENV{'PB CONF'}/pkg1/deb") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb";390 open(CONF,"> $ENV{'PB CONF'}/pkg1/deb/control") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb/control";453 pb_mkdir_p("$ENV{'PBROOT'}/pkg1/deb") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb"; 454 open(CONF,"> $ENV{'PBROOT'}/pkg1/deb/control") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb/control"; 391 455 print CONF << "EOF"; 392 456 Source: PBPKG … … 411 475 EOF 412 476 close(CONF); 413 open(CONF,"> $ENV{'PB CONF'}/pkg1/deb/copyright") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb/copyright";477 open(CONF,"> $ENV{'PBROOT'}/pkg1/deb/copyright") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb/copyright"; 414 478 print CONF << "EOF"; 415 479 This package is debianized by PBPACKAGER … … 442 506 EOF 443 507 close(CONF); 444 open(CONF,"> $ENV{'PB CONF'}/pkg1/deb/changelog") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb/changelog";508 open(CONF,"> $ENV{'PBROOT'}/pkg1/deb/changelog") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb/changelog"; 445 509 print CONF << "EOF"; 446 510 PBLOG 447 511 EOF 448 512 close(CONF); 449 open(CONF,"> $ENV{'PB CONF'}/pkg1/deb/compat") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb/compat";513 open(CONF,"> $ENV{'PBROOT'}/pkg1/deb/compat") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb/compat"; 450 514 print CONF << "EOF"; 451 515 4 452 516 EOF 453 517 close(CONF); 454 open(CONF,"> $ENV{'PB CONF'}/pkg1/deb/pkg1.dirs") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb/pkg1.dirs";518 open(CONF,"> $ENV{'PBROOT'}/pkg1/deb/pkg1.dirs") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb/pkg1.dirs"; 455 519 print CONF << "EOF"; 456 520 EOF 457 521 close(CONF); 458 open(CONF,"> $ENV{'PB CONF'}/pkg1/deb/pkg1.docs") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb/pkg1.docs";522 open(CONF,"> $ENV{'PBROOT'}/pkg1/deb/pkg1.docs") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb/pkg1.docs"; 459 523 print CONF << "EOF"; 460 524 INSTALL … … 465 529 EOF 466 530 close(CONF); 467 open(CONF,"> $ENV{'PB CONF'}/pkg1/deb/rules") || die "Unable to create $ENV{'PBCONF'}/pkg1/deb/rules";531 open(CONF,"> $ENV{'PBROOT'}/pkg1/deb/rules") || die "Unable to create $ENV{'PBROOT'}/pkg1/deb/rules"; 468 532 print CONF << 'EOF'; 469 533 #!/usr/bin/make -f … … 602 666 EOF 603 667 close(CONF); 604 pb_mkdir_p("$ENV{'PB CONF'}/pkg1/rpm") || die "Unable to create $ENV{'PBCONF'}/pkg1/rpm";605 open(CONF,"> $ENV{'PB CONF'}/pkg1/rpm/pkg1.spec") || die "Unable to create $ENV{'PBCONF'}/pkg1/rpm/pkg1.spec";668 pb_mkdir_p("$ENV{'PBROOT'}/pkg1/rpm") || die "Unable to create $ENV{'PBROOT'}/pkg1/rpm"; 669 open(CONF,"> $ENV{'PBROOT'}/pkg1/rpm/pkg1.spec") || die "Unable to create $ENV{'PBROOT'}/pkg1/rpm/pkg1.spec"; 606 670 print CONF << 'EOF'; 607 671 # … … 652 716 EOF 653 717 close(CONF); 654 pb_mkdir_p("$ENV{'PB CONF'}/pkg1/pbfilter") || die "Unable to create $ENV{'PBCONF'}/pkg1/pbfilter";718 pb_mkdir_p("$ENV{'PBROOT'}/pkg1/pbfilter") || die "Unable to create $ENV{'PBROOT'}/pkg1/pbfilter"; 655 719 656 720 print "\nDo not to forget to commit the pbconf directory in your CMS if needed\n"; 657 721 print "After having renamed the pkg1 directory to your package's name \n\n"; 658 722 } else { 659 die "Unable to open $ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb";723 die "Unable to open $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb"; 660 724 } 661 725 } 662 726 umask 0022; 663 return($debug,$LOG, \%pbconf,\%filteredfiles, \%supfiles, \%defpkgdir, \%extpkgdir);727 return($debug,$LOG, \%filteredfiles, \%supfiles, \%defpkgdir, \%extpkgdir); 664 728 } 665 729 … … 738 802 # Everything is returned via ptr1 739 803 my @ptr1 = pb_conf_read_if("$ENV{'PBETC'}", @param); 740 my @ptr2 = pb_conf_read_if("$ENV{'PB CONF'}/$ENV{'PBPROJ'}.pb", @param);804 my @ptr2 = pb_conf_read_if("$ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb", @param); 741 805 742 806 my $p1; … … 825 889 826 890 # Analyze a url passed and return protocol, account, password, server, port, path 827 sub pb_get_url { 828 829 my $url = shift || undef; 830 831 # A URL has the format protocol://ac@host[:port][path[?query][#fragment]]. 832 my $url_regex = "([a-z]+?)://([-\w]+.[-\w.]*)(\d+)?(/.*)?"; 833 834 my ($proto,$account,$passwd,$server,$port,$path) = ; 891 sub pb_get_uri { 892 893 my $uri = shift || undef; 894 895 # A URL has the format protocol://[ac@]host[:port][path[?query][#fragment]]. 896 # Cf man URI 897 my ($scheme, $authority, $path, $query, $fragment) = 898 $uri =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|; 899 my ($account,$host,$port) = $authority =~ m|(?:([^\@]+)\@)?([^:]+)(:(?:[0-9]+))?|; 900 print "DEBUG: scheme:$scheme ac:$account host:$host port:$port path:$path\n" if ($debug >= 1); 901 return($scheme, $account, $host, $port, $path); 835 902 } 836 903 … … 975 1042 sub pb_cms_getinfo { 976 1043 my $cms = shift; 1044 my $dir = shift; 977 1045 my $url = ""; 978 1046 my $void = ""; 979 1047 980 if ($cms->{$ENV{'PBPROJ'}} eq "svn") {981 open(PIPE,"LANGUAGE=C svn info $ ENV{'PBROOT'} |") || die "Unable to get svn info from $ENV{'PBROOT'}";1048 if ($cms->{$ENV{'PBPROJ'}} =~ /^svn/) { 1049 open(PIPE,"LANGUAGE=C svn info $dir |") || return(""); 982 1050 while (<PIPE>) { 983 1051 ($void,$url) = split(/^URL:/) if (/^URL:/); … … 1076 1144 1077 1145 # Global filter files first, then package specificities 1078 if (-d "$ENV{'PB CONF'}/pbfilter") {1079 $mfile00 = "$ENV{'PB CONF'}/pbfilter/all.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/all.pbf");1080 $mfile0 = "$ENV{'PB CONF'}/pbfilter/$dtype.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$dtype.pbf");1081 $mfile1 = "$ENV{'PB CONF'}/pbfilter/$dfam.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$dfam.pbf");1082 $mfile2 = "$ENV{'PB CONF'}/pbfilter/$ddir.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$ddir.pbf");1083 $mfile3 = "$ENV{'PB CONF'}/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$ddir-$dver.pbf");1146 if (-d "$ENV{'PBROOT'}/pbfilter") { 1147 $mfile00 = "$ENV{'PBROOT'}/pbfilter/all.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/all.pbf"); 1148 $mfile0 = "$ENV{'PBROOT'}/pbfilter/$dtype.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$dtype.pbf"); 1149 $mfile1 = "$ENV{'PBROOT'}/pbfilter/$dfam.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$dfam.pbf"); 1150 $mfile2 = "$ENV{'PBROOT'}/pbfilter/$ddir.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$ddir.pbf"); 1151 $mfile3 = "$ENV{'PBROOT'}/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBROOT'}/pbfilter/$ddir-$dver.pbf"); 1084 1152 1085 1153 push @ffiles,$mfile00 if (defined $mfile00); … … 1090 1158 } 1091 1159 1092 if (-d "$ENV{'PB CONF'}/$pbpkg/pbfilter") {1093 $ffile00 = "$ENV{'PB CONF'}/$pbpkg/pbfilter/all.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/all.pbf");1094 $ffile0 = "$ENV{'PB CONF'}/$pbpkg/pbfilter/$dtype.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dtype.pbf");1095 $ffile1 = "$ENV{'PB CONF'}/$pbpkg/pbfilter/$dfam.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dfam.pbf");1096 $ffile2 = "$ENV{'PB CONF'}/$pbpkg/pbfilter/$ddir.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir.pbf");1097 $ffile3 = "$ENV{'PB CONF'}/$pbpkg/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir-$dver.pbf");1160 if (-d "$ENV{'PBROOT'}/$pbpkg/pbfilter") { 1161 $ffile00 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/all.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/all.pbf"); 1162 $ffile0 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dtype.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dtype.pbf"); 1163 $ffile1 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dfam.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$dfam.pbf"); 1164 $ffile2 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir.pbf"); 1165 $ffile3 = "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBROOT'}/$pbpkg/pbfilter/$ddir-$dver.pbf"); 1098 1166 1099 1167 push @ffiles,$ffile00 if (defined $ffile00);
Note:
See TracChangeset
for help on using the changeset viewer.