- Timestamp:
- Sep 3, 2007, 4:09:00 AM (17 years ago)
- Location:
- devel/pb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r78 r79 43 43 my @date=(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst()); 44 44 my $pbdate = strftime("%Y-%m-%d", @date); 45 $ENV{'PBDATE'}=$pbdate; 45 46 46 47 getopts('hl:p:qr:tv',\%opts); … … 128 129 print $LOG "Management of $pbpkg $pbver-$pbtag (rev $pbrev)\n" if ($debug >= 0); 129 130 die "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'}); 131 # Put some var in env to allow filtering 132 $ENV{'PBVER'}=$pbver; 133 $ENV{'PBTAG'}=$pbtag; 134 $ENV{'PBPKG'}=$pbpkg; 135 $ENV{'PBREV'}=$pbrev; 130 136 # Clean up dest if necessary. The export will recreate it 131 137 my $dest = "$ENV{'PBDESTDIR'}/$pbpkg-$pbver"; … … 211 217 if (defined $ptr) { 212 218 foreach my $f (values %bfiles) { 213 pb_filter_file_pb("$ENV{'PBROOT'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$ pbpkg,$pbtag,$dtype,$dsuf);219 pb_filter_file_pb("$ENV{'PBROOT'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$dtype,$dsuf); 214 220 } 215 221 if (defined $filteredfiles{$dir}) { … … 247 253 open(LAST,"> $pbrc{$ENV{'PBPROJ'}}") || die "Unable to create $pbrc{$ENV{'PBPROJ'}}"; 248 254 foreach my $v (keys %pbver) { 249 print LAST "pbroot $v-_-$pbver{ v}-$pbtag{v} = $ENV{'PBROOT'}\n";255 print LAST "pbroot $v-_-$pbver{$v}-$pbtag{$v} = $ENV{'PBROOT'}\n"; 250 256 } 251 257 close(LAST); -
devel/pb/lib/ProjectBuilder/Base.pm
r78 r79 314 314 my $dver = shift || die "No dver specified"; 315 315 my $ptr; # returned value pointer on the hash of filters 316 my %ptr; 316 317 317 318 if (-d "$ENV{'PBCONF'}/$pbpkg/pbfilter") { … … 326 327 push @ffiles,$ffile3 if (defined $ffile3); 327 328 } 328 my $config = AppConfig->new({329 # Auto Create variables mentioned in Conf file330 CREATE => 1,331 DEBUG => 0,332 GLOBAL => {333 # Each conf item is a hash334 ARGCOUNT => AppConfig::ARGCOUNT_HASH335 }336 });337 338 329 if (@ffiles) { 339 330 print $LOG "DEBUG ffiles: ".Dumper(\@ffiles)."\n" if ($debug >= 1); 331 332 my $config = AppConfig->new({ 333 # Auto Create variables mentioned in Conf file 334 CREATE => 1, 335 DEBUG => 0, 336 GLOBAL => { 337 # Each conf item is a hash 338 ARGCOUNT => AppConfig::ARGCOUNT_HASH 339 } 340 }); 341 340 342 $config->file(@ffiles); 341 343 $ptr = $config->get("filter"); … … 344 346 $ptr = { }; 345 347 } 346 return($ptr); 348 %ptr = %$ptr; 349 return(\%ptr); 347 350 } 348 351 … … 354 357 my %filter=%$ptr; 355 358 my $destfile=shift; 356 my $pbpkg=shift;357 my $pbtag=shift;358 359 my $dtype=shift; 359 360 my $dsuf=shift; … … 367 368 foreach my $s (keys %filter) { 368 369 # Process single variables 369 print $LOG "DEBUG filter{$s}: $filter{$s}\n" if ($debug > 1);370 print $LOG "DEBUG filter{$s}: $filter{$s}\n" if ($debug >= 1); 370 371 my $tmp = $filter{$s}; 371 372 next if (not defined $tmp); 372 373 # Expand variables if any single one found 374 print $LOG "DEBUG tmp: $tmp\n" if ($debug >= 1); 373 375 if ($tmp =~ /\$/) { 374 376 eval { $tmp =~ s/(\$\w+)/$1/eeg }; … … 376 378 } elsif (($tmp =~ /^yes$/) && ($s =~ /^PBLOG$/) && ($line =~ /^PBLOG$/)) { 377 379 $tmp = ""; 378 my $p = $defpkgdir{$ pbpkg};379 $p = $extpkgdir{$ pbpkg} if (not defined $p);380 pb_changelog($dtype, $ pbpkg, $pbtag, $dsuf, $p, \*DEST);380 my $p = $defpkgdir{$ENV{'PBPKG'}}; 381 $p = $extpkgdir{$ENV{'PBPKG'}} if (not defined $p); 382 pb_changelog($dtype, $ENV{'PBPKG'}, $ENV{'PBTAG'}, $dsuf, $p, \*DEST); 381 383 } 382 384 $line =~ s|$s|$tmp|;
Note:
See TracChangeset
for help on using the changeset viewer.