- Timestamp:
- Jul 31, 2007, 12:50:36 AM (18 years ago)
- Location:
- devel
- Files:
-
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb.pl
r17 r18 10 10 # Syntax: pb [-p project] <action> [<params>...] 11 11 12 use strict ;12 use strict 'vars'; 13 13 use Switch; 14 14 use Getopt::Std; … … 21 21 use POSIX qw(strftime); 22 22 23 use vars qw (%defpkgdir %extpkgdir %version %confparam %filteredfiles); 23 24 use lib qw (lib); 24 use vars qw (%defpkgdir %extpkgdir %version %param %filteredfiles);25 25 use common qw (env_init); 26 use pb qw ( defpkgdir extpkgdir version param filteredfilespb_init);26 use pb qw (pb_init); 27 27 use distro qw (distro_init); 28 28 use cms; … … 70 70 } elsif ($ARGV[0] =~ /^all$/) { 71 71 @pkgs = keys %defpkgdir; 72 push(@pkgs, keys %extpkgdir); 72 if (defined %extpkgdir) { 73 my $k = keys %extpkgdir; 74 if (defined $k) { 75 push(@pkgs, keys %extpkgdir); 76 } 77 } 73 78 } else { 74 79 @pkgs = @ARGV; … … 231 236 } 232 237 } 233 # Prepare the dest directory for archive 234 if (-x "$ENV{'PBCONF'}/$pkg/pbpkginit") { 235 system("cd $dest ; $ENV{'PBCONF'}/$pkg/pbinit"); 236 if ($? == -1) { 237 print "failed to execute: $!\n"; 238 } elsif ($? & 127) { 239 printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; 240 } else { 241 print " $dest\n"; 242 } 243 } 244 # Archive dest dir 245 chdir "$dest/.."; 246 print "Creating $pkg tar files (gzip... "; 247 system("tar cfphz $pkg-$pbver.tar.gz $pkg-$pbver"); 238 } 239 close(D); 240 # Prepare the dest directory for archive 241 if (-x "$ENV{'PBCONF'}/$pkg/pbpkginit") { 242 system("cd $dest ; $ENV{'PBCONF'}/$pkg/pbinit"); 248 243 if ($? == -1) { 249 244 print "failed to execute: $!\n"; … … 251 246 printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; 252 247 } else { 253 print " OK)\n"; 254 print "Under $dest/../$pkg-$pbver.tar.gz\n"; 255 } 256 } 257 close(D); 248 print " $dest\n"; 249 } 250 } 251 # Archive dest dir 252 chdir "$dest/.."; 253 print "Creating $pkg tar files (gzip... "; 254 system("tar cfphz $pkg-$pbver.tar.gz $pkg-$pbver"); 255 if ($? == -1) { 256 print "failed to execute: $!\n"; 257 } elsif ($? & 127) { 258 printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; 259 } else { 260 print " OK)\n"; 261 print "Under $dest/../$pkg-$pbver.tar.gz\n"; 262 } 258 263 } 259 264 } else { … … 290 295 # special case for ChangeLog 291 296 } elsif (($tmp =~ /^yes$/) && ($s =~ /^PBLOG$/)) { 292 $tmp = changelog($dtype, $pkg, $pbtag, $dsuf, \*DEST); 297 my $p = $defpkgdir{$pkg}; 298 $p = $extpkgdir{$pkg} if (not defined $p); 299 $tmp = changelog($dtype, $pkg, $pbtag, $dsuf, $p, \*DEST); 293 300 } 294 301 $line =~ s|$s|$tmp|; -
devel/pb/lib/changelog.pm
r17 r18 17 17 my $pbtag = shift; 18 18 my $dsuf = shift; 19 my $path = shift; 19 20 my $OUTPUT = shift; 20 21 … … 26 27 return("\n") if ((not (defined $dtype)) || ($dtype eq "") || 27 28 (not (defined $pkg)) || ($pkg eq "") || 29 (not (defined $pbtag)) || ($pbtag eq "") || 30 (not (defined $dsuf)) || ($dsuf eq "") || 31 (not (defined $path)) || ($path eq "") || 28 32 (not (defined $OUTPUT)) || ($OUTPUT eq "")); 29 33 30 my $chglog = "$ENV{'PBROOT'}/$p kg/ChangeLog";34 my $chglog = "$ENV{'PBROOT'}/$path/ChangeLog"; 31 35 if (! -f $chglog) { 32 print "Unable to find a ChangeLog filefor $pkg\n";36 print "Unable to find the ChangeLog file ($chglog) for $pkg\n"; 33 37 return("\n"); 34 38 } … … 72 76 $ver2 = "$ver$dsuf"; 73 77 } 74 print $OUTPUT "* $ndate Bruno Cornec <bruno\@mondorescue.org>$ver2\n";78 print $OUTPUT "* $ndate $confparam{'packager'} $ver2\n"; 75 79 print $OUTPUT "- Updated to $ver\n"; 76 80 } … … 95 99 96 100 if ($dtype eq "deb") { 97 print $OUTPUT " -- Bruno Cornec <bruno\@mondorescue.org>$n2date\n\n";101 print $OUTPUT " -- $confparam{'packager'} $n2date\n\n"; 98 102 print $OUTPUT "\n"; 99 103 } -
devel/pb/lib/cms.pm
r9 r18 5 5 # $Id$ 6 6 # 7 8 require Exporter;9 @ISA = qw(Exporter);10 @EXPORT = qw(get_toolhome);11 7 12 8 use strict; -
devel/pb/lib/common.pm
r17 r18 5 5 # $Id$ 6 6 # 7 require Exporter;8 @ISA = qw(Exporter);9 @EXPORT = qw(env_init);10 7 8 use strict; 11 9 use lib qw (lib); 12 10 use pb qw (pb_init); 13 use strict;14 11 use File::Basename; 15 12 use File::Path; 16 13 use File::Temp qw /tempdir/; 17 use vars qw (%defpkgdir %extpkgdir %version %param);18 14 use Data::Dumper; 19 15 … … 43 39 # Check content 44 40 # 45 if (not defined $ param{"pbroot"}) {46 die " param pbroot doesn't exist in $ENV{'PBETC'}/$proj.pb";41 if (not defined $confparam{"pbroot"}) { 42 die "confparam pbroot doesn't exist in $ENV{'PBETC'}/$proj.pb"; 47 43 } else { 48 $ENV{'PBROOT'} = $ param{"pbroot"};44 $ENV{'PBROOT'} = $confparam{"pbroot"}; 49 45 } 50 if (defined $ param{"cvsroot"}) {51 $ENV{'CVSROOT'} = $ param{"cvsroot"};46 if (defined $confparam{"cvsroot"}) { 47 $ENV{'CVSROOT'} = $confparam{"cvsroot"}; 52 48 } 53 49 -
devel/pb/lib/distro.pm
r13 r18 5 5 # $Id$ 6 6 # 7 8 require Exporter;9 @ISA = qw(Exporter);10 @EXPORT = qw(distro_init distro_get);11 7 12 8 use strict; -
devel/pb/lib/pb.pm
r17 r18 1 1 #!/usr/bin/perl -w 2 2 # 3 # Project Builder configuration file 3 # Project Builder configuration file handler 4 4 # For project pb ;-) 5 5 # … … 7 7 # 8 8 use strict; 9 use Exporter();10 use vars qw(@ISA @EXPORT_OK);11 @ISA = qw(Exporter);12 # global vars are here13 @EXPORT_OK = qw(%defpkgdir %extpkgdir %version %param %filteredfiles &pb_init);14 use vars @EXPORT_OK;15 9 use AppConfig qw(ARGCOUNT_HASH); 16 10 … … 33 27 # Root of the project to build 34 28 # needs at least 2 levels of dir as in the upper 35 # other dirs will be created and used 36 $ptr = $config->get("param"); 37 %param = %$ptr; 29 # other dirs will be created and used 38 30 39 # List of pkg to build by default 31 # main parameter hash (mandatory) 32 $ptr = $config->get("confparam") || die "Unable to find confparam in $conffile"; 33 %confparam = %$ptr; 34 35 # List of pkg to build by default (mandatory) 40 36 $ptr = $config->get("defpkgdir") || die "Unable to find defpkgdir in $conffile"; 41 37 %defpkgdir = %$ptr; 42 38 43 # List of additional pkg to build when all is called 39 # List of additional pkg to build when all is called (optional) 44 40 $ptr = $config->get("extpkgdir"); 45 %extpkgdir = %$ptr; 41 if (not defined $ptr) { 42 %extpkgdir = (); 43 } else { 44 %extpkgdir = %$ptr; 45 } 46 46 47 # Valid version names 47 # Valid version names (optional) 48 48 $ptr = $config->get("version"); 49 %version = %$ptr; 49 if (not defined $ptr) { 50 %version = (); 51 } else { 52 %version = %$ptr; 53 } 50 54 51 # List of files to filter 55 # List of files to filter (optional) 52 56 $ptr = $config->get("filteredfiles"); 53 %filteredfiles = %$ptr; 57 if (not defined $ptr) { 58 %filteredfiles = (); 59 } else { 60 %filteredfiles = %$ptr; 61 } 54 62 55 63 } -
devel/pbconf/pb.pb
r17 r18 6 6 # 7 7 8 # param is a hash to ease interface8 # confparam is a hash to ease interface 9 9 # Root directory of the pb project 10 param pbroot = "/users/bruno/pb/svn/devel"10 confparam pbroot = "/users/bruno/pb/svn/devel" 11 11 12 12 # Packager for ChangeLogs 13 param packager = "Bruno Cornec <bruno\@mondorescue.org>"13 confparam packager = "Bruno Cornec <bruno\@mondorescue.org>" 14 14 15 15 # If CVS give login method with CVSROOT 16 16 #cvsroot = ":pserver:anonymous@linuxcoe.cvs.sourceforge.net:/cvsroot/linuxcoe" 17 param cvsroot = " "17 confparam cvsroot = " " 18 18 19 19 # Hash of default package/package directory
Note:
See TracChangeset
for help on using the changeset viewer.