Ignore:
Timestamp:
Sep 3, 2007, 4:09:00 AM (12 years ago)
Author:
bruno
Message:

Use more nv variables to deal with filters easily even outside ou pb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/ProjectBuilder/Base.pm

    r78 r79  
    314314my $dver = shift || die "No dver specified";
    315315my $ptr; # returned value pointer on the hash of filters
     316my %ptr;
    316317
    317318if (-d "$ENV{'PBCONF'}/$pbpkg/pbfilter") {
     
    326327    push @ffiles,$ffile3 if (defined $ffile3);
    327328}
    328 my $config = AppConfig->new({
    329     # Auto Create variables mentioned in Conf file
    330     CREATE => 1,
    331     DEBUG => 0,
    332     GLOBAL => {
    333         # Each conf item is a hash
    334         ARGCOUNT => AppConfig::ARGCOUNT_HASH
    335     }
    336 });
    337 
    338329if (@ffiles) {
    339330    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
    340342    $config->file(@ffiles);
    341343    $ptr = $config->get("filter");
     
    344346    $ptr = { };
    345347}
    346 return($ptr);
     348%ptr = %$ptr;
     349return(\%ptr);
    347350}
    348351
     
    354357my %filter=%$ptr;
    355358my $destfile=shift;
    356 my $pbpkg=shift;
    357 my $pbtag=shift;
    358359my $dtype=shift;
    359360my $dsuf=shift;
     
    367368    foreach my $s (keys %filter) {
    368369        # 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);
    370371        my $tmp = $filter{$s};
    371372        next if (not defined $tmp);
    372373        # Expand variables if any single one found
     374        print $LOG "DEBUG tmp: $tmp\n" if ($debug >= 1);
    373375        if ($tmp =~ /\$/) {
    374376            eval { $tmp =~ s/(\$\w+)/$1/eeg };
     
    376378        } elsif (($tmp =~ /^yes$/) && ($s =~ /^PBLOG$/) && ($line =~ /^PBLOG$/)) {
    377379            $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);
    381383        }
    382384        $line =~ s|$s|$tmp|;
Note: See TracChangeset for help on using the changeset viewer.