- Timestamp:
- Mar 31, 2008, 2:04:24 AM (16 years ago)
- Location:
- devel/pb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r341 r344 587 587 # Possibility to look at PBSRC to guess more the filename 588 588 pb_system("tar cfz $pbpkg-$pbver.tar.gz $pbpkg-$pbver","Creating $pbpkg tar files compressed"); 589 pb_log( 2,"Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n");589 pb_log(0,"Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n"); 590 590 591 591 # Keep track of what is generated by default -
devel/pb/lib/ProjectBuilder/Base.pm
r343 r344 119 119 120 120 my ($pbdefdir) = pb_conf_get_if("pbdefdir"); 121 my %pbdefdir = %$pbdefdir;122 121 123 122 if (not defined $ENV{'PBDEFDIR'}) { 124 if ((not defined $pbdefdir) || (not defined $pbdefdir {$ENV{'PBPROJ'}})) {123 if ((not defined $pbdefdir) || (not defined $pbdefdir->{$ENV{'PBPROJ'}})) { 125 124 pb_log(1,"WARNING: no pbdefdir defined, using /var/cache\n"); 126 125 pb_log(1," Please create a pbdefdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n"); … … 129 128 } else { 130 129 # That's always the environment variable that will be used 131 $ENV{'PBDEFDIR'} = $pbdefdir {$ENV{'PBPROJ'}};130 $ENV{'PBDEFDIR'} = $pbdefdir->{$ENV{'PBPROJ'}}; 132 131 } 133 132 } … … 225 224 # transform in full path if relative 226 225 $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}/$ENV{'PBROOTDIR'}" if ($ENV{'PBROOTDIR'} !~ /^\//); 226 pb_mkdir_p($ENV{'PBROOTDIR'}) if (defined $pbinit); 227 227 die "$ENV{'PBROOTDIR'} is not a directory" if (not -d $ENV{'PBROOTDIR'}); 228 228 } … … 308 308 #pburl $ENV{'PBPROJ'} = dir:///src/$ENV{'PBPROJ'}-devel 309 309 310 # Check whether project is well formed 311 # (containing already a directory with the project-version name) 312 #pbwf $ENV{'PBPROJ'} = 1 313 310 314 # 311 315 # Packager label 312 316 # 313 #pbpackager $ENV{'PBPROJ'} = "William Porte <bill\@$ENV{'PBPROJ'}.org>"317 #pbpackager $ENV{'PBPROJ'} = William Porte <bill\@$ENV{'PBPROJ'}.org> 314 318 # 315 319 … … 424 428 425 429 # PBVER is replaced by the version (\$pbver in code) 426 #filter PBVER = \$pbver430 filter PBVER = \$pbver 427 431 428 432 # PBDATE is replaced by the date (\$pbdate in code) 429 #filter PBDATE = \$pbdate433 filter PBDATE = \$pbdate 430 434 431 435 # PBLOG is replaced by the changelog if value is yes … … 433 437 434 438 # PBTAG is replaced by the tag (\$pbtag in code) 435 #filter PBTAG = \$pbtag439 filter PBTAG = \$pbtag 436 440 437 441 # PBREV is replaced by the revision (\$pbrev in code) 438 #filter PBREV = \$pbrev442 filter PBREV = \$pbrev 439 443 440 444 # PBPKG is replaced by the package name (\$pbpkg in code) 441 #filter PBPKG = \$pbpkg445 filter PBPKG = \$pbpkg 442 446 443 447 # PBPACKAGER is replaced by the packager name (\$pbpackager in code) 444 #filter PBPACKAGER = \$pbpackager448 filter PBPACKAGER = \$pbpackager 445 449 446 450 # PBDESC contains the description of the package … … 470 474 #filter PBDEP = 471 475 472 # PBSUF is replaced by the package name (\$pbpkgin code)473 #filter PBSUF = \$pbsuf476 # PBSUF is replaced by the package suffix (\$pbsuf in code) 477 filter PBSUF = \$pbsuf 474 478 475 479 # PBOBS is replaced by the Obsolete line … … 486 490 # 487 491 # PBGRP is replaced by the group of apps 488 #filter PBGRP = utils492 filter PBGRP = utils 489 493 490 494 # PBLIC is replaced by the license of the application … … 507 511 # Specific group for Mandriva for $ENV{'PBPROJ'} 508 512 # Cf: http://wiki.mandriva.com/en/Development/Packaging/Groups 509 filter PBGRP = Archiving/Backup513 #filter PBGRP = Archiving/Backup 510 514 511 515 # PBLIC is replaced by the license of the application … … 519 523 # Specific group for SuSE for $ENV{'PBPROJ'} 520 524 # Cf: http://en.opensuse.org/SUSE_Package_Conventions/RPM_Groups 521 filter PBGRP = Productivity/Archiving/Backup525 #filter PBGRP = Productivity/Archiving/Backup 522 526 523 527 # PBLIC is replaced by the license of the application … … 593 597 EOF 594 598 close(CONF); 595 open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/ pkg1.dirs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs";599 open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs"; 596 600 print CONF << "EOF"; 597 601 EOF … … 761 765 Source: PBSRC 762 766 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) 763 Requires: PBDEP767 #Requires: PBDEP 764 768 765 769 %description … … 1089 1093 pb_mkdir_p($destdir); 1090 1094 1095 # Check whether the file is well formed 1096 # (containing already a directory with the project-version name) 1097 my ($pbwf) = pb_conf_get_if("pbwf"); 1098 if ((defined $pbwf) && (defined $pbwf->{$ENV{'PBPROJ'}})) { 1099 $destdir = dirname($destdir); 1100 } 1101 1091 1102 if ($mm =~ /\/x-bzip-compressed-tar$/) { 1092 1103 # tar+bzip2 … … 1105 1116 pb_system("cd $destdir ; unzip $path","Extracting $path in $destdir"); 1106 1117 } 1107 # Maybe we created an extra level of dir under destdir1108 opendir(DIR,$destdir) || die "Unable to open $destdir";1109 my $cnt = 0;1110 my $d0;1111 foreach my $d (readdir(DIR)) {1112 pb_log(3,"Looking at \'$d\'...");1113 next if ($d =~ /^\./);1114 $cnt++;1115 $d0 = $d;1116 }1117 closedir(DIR);1118 # Fix that by moving everything below that extra dir under destdir1119 # and remove the extra dir1120 if ($cnt == 1) {1121 pb_system("cd $destdir/$d0 ; mv * .??* .. 2>/dev/null");1122 pb_rm_rf("$destdir/$d0");1123 }1124 1118 } elsif ($scheme =~ /^cvs/) { 1125 1119 # CVS needs a relative path ! … … 1301 1295 if ($scheme =~ /^svn/) { 1302 1296 pb_system("svn co $url $destination","Checking out $url to $destination "); 1303 } elsif ($scheme eq "flat") { 1297 } elsif (($scheme eq "ftp") || ($scheme eq "http")) { 1298 return; 1304 1299 } elsif ($scheme =~ /^cvs/) { 1300 pb_system("cvs co $url $destination","Checking out $url to $destination "); 1305 1301 } else { 1306 1302 die "cms $scheme unknown"; … … 1354 1350 my $ddir = shift || ""; 1355 1351 my $dver = shift || ""; 1356 my $ptr; # returned value pointer on the hash of filters 1357 my %ptr; 1352 my $ptr = undef; # returned value pointer on the hash of filters 1358 1353 my %h; 1359 1354 … … 1401 1396 pb_log(2,"DEBUG f:".Dumper($ptr)."\n"); 1402 1397 } 1403 } else { 1404 $ptr = { }; 1405 } 1406 %ptr = %$ptr; 1407 return(\%ptr); 1398 } 1399 return($ptr); 1408 1400 } 1409 1401 … … 1591 1583 1592 1584 if ((! -d "$ENV{$envar}") || (defined $pbinit)) { 1593 pb_log(1,"Checking out $uri\n"); 1594 pb_cms_checkout($scheme,$uri,$ENV{$envar}); 1585 if (defined $pbinit) { 1586 pb_mkdir_p("$ENV{$envar}"); 1587 } else { 1588 pb_log(1,"Checking out $uri\n"); 1589 pb_cms_checkout($scheme,$uri,$ENV{$envar}); 1590 } 1595 1591 } elsif (($scheme !~ /^cvs/) || ($scheme !~ /^svn/)) { 1596 1592 # Do not compare if it's not a real cms … … 1653 1649 my $ver; 1654 1650 my $ver2; 1655 my ($packager) = pb_conf_get("pbpackager"); 1651 my ($pbpackager) = pb_conf_get("pbpackager"); 1652 1653 if (not defined $pbpackager->{$ENV{'PBPROJ'}}) { 1654 $pbpackager->{$ENV{'PBPROJ'}} = "undefined\@noproject.noorg"; 1655 } 1656 1656 1657 1657 # If we don't need to do it, or don't have it fake something … … 1663 1663 if (($dtype eq "rpm") || ($dtype eq "fc")) { 1664 1664 $ver2 = "$pbver-$pbtag$dsuf"; 1665 print $OUTPUT "* $ndate $p ackager->{$ENV{'PBPROJ'}} $ver2\n";1665 print $OUTPUT "* $ndate $pbpackager->{$ENV{'PBPROJ'}} $ver2\n"; 1666 1666 print $OUTPUT "- Updated to $pbver\n"; 1667 1667 } … … 1669 1669 print $OUTPUT "$pkg ($pbver) unstable; urgency=low\n"; 1670 1670 print $OUTPUT "\n"; 1671 print $OUTPUT " -- $p ackager->{$ENV{'PBPROJ'}} $n2date\n\n\n";1671 print $OUTPUT " -- $pbpackager->{$ENV{'PBPROJ'}} $n2date\n\n\n"; 1672 1672 } 1673 1673 return; … … 1712 1712 $ver2 = "$ver$dsuf"; 1713 1713 } 1714 print $OUTPUT "* $ndate $p ackager->{$ENV{'PBPROJ'}} $ver2\n";1714 print $OUTPUT "* $ndate $pbpackager->{$ENV{'PBPROJ'}} $ver2\n"; 1715 1715 print $OUTPUT "- Updated to $ver\n"; 1716 1716 } … … 1737 1737 if ($dtype eq "deb") { 1738 1738 # Cf: http://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog 1739 print $OUTPUT " -- $p ackager->{$ENV{'PBPROJ'}} $n2date\n\n\n";1739 print $OUTPUT " -- $pbpackager->{$ENV{'PBPROJ'}} $n2date\n\n\n"; 1740 1740 } 1741 1741
Note:
See TracChangeset
for help on using the changeset viewer.