Changeset 15 in ProjectBuilder for devel/pb


Ignore:
Timestamp:
Jul 30, 2007, 2:47:27 PM (17 years ago)
Author:
Bruno Cornec
Message:

Begin to deal with filters

Location:
devel/pb
Files:
5 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb.pl

    r14 r15  
    1919
    2020use lib qw (lib etc);
    21 use vars qw (%defpkgdir %extpkgdir %version);
     21use vars qw (%defpkgdir %extpkgdir %version @filteredfiles);
    2222use common qw (env_init);
    23 use pb qw (defpkgdir extpkgdir version pb_init);
     23use pb qw (defpkgdir extpkgdir version filteredfiles pb_init);
    2424use distro qw (distro_init);
    2525use cms;
     
    167167            }
    168168
     169            # Get all filters to apply
     170            # They're cumulative from less specific to most specific
     171            # suffix is .pbf
     172            if (-d "$ENV{'PBCONF'}/$p/pbfilter") {
     173                opendir(BDIR,"$ENV{'PBCONF'}/$p/pbfilter" || die "Unable to open dir $ENV{'PBCONF'}/$p/pbfilter: $!");
     174                foreach my $f (readdir(BDIR)) {
     175                    if (-f "$ENV{'PBCONF'}/$p/pbfilter/$dtype.pbf") {
     176
     177                @bfiles = grep { ! /^\./ && -f "$ENV{'PBCONF'}/$p/$dtype/$_" } readdir(BDIR);
     178                closedir(BDIR);
     179            }
     180
    169181        }
    170182        close(D);
  • devel/pb/lib/pb.pm

    r8 r15  
    1111@ISA = qw(Exporter);
    1212# global vars are here
    13 @EXPORT_OK = qw(%defpkgdir %extpkgdir %version &pb_init);
     13@EXPORT_OK = qw(%defpkgdir %extpkgdir %version @filteredfiles &pb_init);
    1414use vars @EXPORT_OK;
    1515use AppConfig qw(ARGCOUNT_ONE ARGCOUNT_HASH ARGCOUNT_LIST EXPAND_ALL);
     
    3030$config->define("extpkgdir" => { ARGCOUNT => ARGCOUNT_HASH });
    3131$config->define("version" => { ARGCOUNT => ARGCOUNT_HASH });
     32$config->define("filteredfiles" => { ARGCOUNT => ARGCOUNT_LIST });
    3233
    3334$config->file($conffile);
     
    5354%version = %$ptr;
    5455
     56# List of files to filter
     57$ptr = $config->get("filteredfiles");
     58@filteredfiles = @$ptr;
     59
    5560}
    56611;
Note: See TracChangeset for help on using the changeset viewer.