- Timestamp:
- Aug 31, 2007, 3:20:15 PM (17 years ago)
- Location:
- devel/pb
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r68 r69 20 20 use POSIX qw(strftime); 21 21 22 use vars qw (%defpkgdir %extpkgdir %version %confparam %filteredfiles %pbroot$debug $LOG $projectbuilderver $projectbuilderrev);22 use vars qw (%defpkgdir %extpkgdir %version %confparam %filteredfiles $debug $LOG $projectbuilderver $projectbuilderrev); 23 23 $debug = 0; # Debug level 24 24 $LOG = *STDOUT; # Where to log … … 252 252 253 253 # Archive dest dir 254 chdir "$ENV{'PBDESTDIR'}" ;254 chdir "$ENV{'PBDESTDIR'}" || die "Unable to change dir to $ENV{'PBDESTDIR'}"; 255 255 # Possibility to look at PBSRC to guess more the filename 256 256 pbsystem("tar cfpz $pbpkg-$pbver.tar.gz $pbpkg-$pbver","Creating $pbpkg tar files compressed"); 257 257 print $LOG "Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n" if ($debug >= 0); 258 258 # Keep track of what is generated for build2pkg default 259 open(LAST,"> $ENV{'PBDESTDIR'}/ LAST") || die "Unable to create $ENV{'PBDESTDIR'}/LAST";259 open(LAST,"> $ENV{'PBDESTDIR'}/pbrc") || die "Unable to create $ENV{'PBDESTDIR'}/pbrc"; 260 260 print LAST "$pbver-$pbtag\n"; 261 261 close(LAST); … … 265 265 my $vertag = shift @ARGV; 266 266 if (not defined $vertag) { 267 open(LAST,"$ENV{'PBDESTDIR'}/ LAST") || die "Unable to open $ENV{'PBDESTDIR'}/LAST\nYou may want to precise as parameter version-tag";267 open(LAST,"$ENV{'PBDESTDIR'}/pbrc") || die "Unable to open $ENV{'PBDESTDIR'}/pbrc\nYou may want to precise as parameter version-tag"; 268 268 $vertag = <LAST>; 269 269 chomp($vertag); … … 411 411 print "pb (aka project-builder) Version $projectbuilderver-$projectbuilderrev\n"; 412 412 print "\n"; 413 print "Syntax: pb [-vhqt][- p project] <action> [<params>...]\n";413 print "Syntax: pb [-vhqt][-r pbroot][-p project] <action> [<params>...]\n"; 414 414 print "\n"; 415 415 print "-h : This help file\n"; … … 417 417 print "-t : Test mode (not done yet)\n"; 418 418 print "-v : Verbose mode\n"; 419 print "\n"; 420 print "-r pbroot : Path Name of project under the CMS \n"; 421 print " (or use the env variable PBROOT) \n"; 419 422 print "\n"; 420 423 print "-p project : Name of the project you're working on\n"; -
devel/pb/lib/ProjectBuilder/common.pm
r68 r69 32 32 $proj = $ENV{'PBPROJ'}; 33 33 } 34 35 # 36 # We get the pbrc file for that project 37 # and use its content 38 # 39 $pbrc = pb_init("$ENV{'PBETC'}","pbrc"); 40 41 my %pbrc = %$pbrc; 42 if (not defined $proj) { 43 # Take the first as the default project 44 $proj = (keys %pbrc)[0]; 45 print $LOG "Using $proj as default project as none has been specified\n" if (($debug >= 0) and (defined $proj)); 46 } 47 die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj)); 48 49 # 50 # Set delivery directory 51 # 52 my $topdir=basename($pbrc{$proj}); 53 chdir $topdir || die "Unable to change directory to $topdir"; 54 $ENV{'PBDESTDIR'}=$topdir."/delivery"; 55 34 56 # 35 57 # Use project configuration file if needed 36 58 # 37 59 if (not defined $ENV{'PBROOT'}) { 38 pb_init("$ENV{'PBETC'}"); 39 40 if (not defined $proj) { 41 # Take the first as the default project 42 $proj = (keys %pbroot)[0]; 43 print $LOG "Using $proj as default project as none has been specified\n" if (($debug >= 0) and (defined $proj)); 60 if (-f $pbrc{$proj}) { 61 $pbroot = pb_init($pbrc{$proj},"pbroot"); 62 # There is normaly only one line in it 63 $ENV{'PBROOT'} = (values %$pbroot)[0] if (defined $pbroot); 64 print $LOG "Using $ENV{'PBROOT'} as default pbroot from $pbrc{$proj}\n" if (($debug >= 0) and (defined $ENV{'PBROOT'})); 44 65 } 45 die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj)); 46 47 $ENV{'PBROOT'} = $pbroot{$proj}; 48 } else { 49 die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj)); 66 die "No pbroot defined - use env var PBROOT or -r pbroot " if (not defined $ENV{'PBROOT'}); 50 67 } 51 68 … … 101 118 102 119 # 103 # Adapt to your needs 104 # Set delivery directory 105 # Removes all directory existing below as they are temp dir only 120 # Removes all directory existing below the delivery dir 121 # as they are temp dir only 106 122 # Files stay and have to be cleaned up manually 107 123 # 108 chdir "$ENV{'PBROOT'}/..";109 my $path = `pwd`;110 chomp($path);111 $ENV{'PBDESTDIR'}=$path."/delivery";112 124 if (-d $ENV{'PBDESTDIR'}) { 113 125 opendir(DIR,$ENV{'PBDESTDIR'}) || die "Unable to open directory $ENV{'PBDESTDIR'}: $!"; -
devel/pb/lib/ProjectBuilder/pb.pm
r50 r69 9 9 use AppConfig qw(ARGCOUNT_HASH ARGCOUNT_ONE); 10 10 use Data::Dumper; 11 use vars qw (%pbroot);12 11 13 12 sub pb_init { 14 13 15 14 my $conffile = shift; 15 my $param = shift; 16 16 my $trace; 17 17 … … 33 33 }); 34 34 $config->file($conffile); 35 my $ptr = $config->get( "pbroot") || die "Unable to find pbrootin $conffile";35 my $ptr = $config->get($param) || die "Unable to find $param in $conffile"; 36 36 print "DEBUG: pbroot: ".Dumper($ptr)."\n" if ($debug >= 1); 37 %pbroot = %$ptr;37 return($ptr); 38 38 } 39 39
Note:
See TracChangeset
for help on using the changeset viewer.