Changeset 17 in ProjectBuilder for devel/pb/lib


Ignore:
Timestamp:
Jul 30, 2007, 8:03:52 PM (17 years ago)
Author:
Bruno Cornec
Message:

Still in dev. phase - lots of changes - near the end for cms2build

Location:
devel/pb/lib
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/common.pm

    r13 r17  
    1515use File::Path;
    1616use File::Temp qw /tempdir/;
    17 use vars qw (%defpkgdir %extpkgdir %version);
     17use vars qw (%defpkgdir %extpkgdir %version %param);
    1818use Data::Dumper;
    1919
     
    4343# Check content
    4444#
    45 die "PBROOT doesn't exist in $ENV{'PBETC'}/$proj.pb" if (not (defined $ENV{'PBROOT'}));
     45if (not defined $param{"pbroot"}) {
     46    die "param pbroot doesn't exist in $ENV{'PBETC'}/$proj.pb";
     47} else {
     48    $ENV{'PBROOT'} = $param{"pbroot"};
     49}
     50if (defined $param{"cvsroot"}) {
     51    $ENV{'CVSROOT'} = $param{"cvsroot"};
     52}
     53
    4654die "defpkgdir doesn't exist in $ENV{'PBETC'}/$proj.pb" if (not (defined %defpkgdir));
    4755
  • devel/pb/lib/pb.pm

    r15 r17  
    1111@ISA = qw(Exporter);
    1212# global vars are here
    13 @EXPORT_OK = qw(%defpkgdir %extpkgdir %version @filteredfiles &pb_init);
     13@EXPORT_OK = qw(%defpkgdir %extpkgdir %version %param %filteredfiles &pb_init);
    1414use vars @EXPORT_OK;
    15 use AppConfig qw(ARGCOUNT_ONE ARGCOUNT_HASH ARGCOUNT_LIST EXPAND_ALL);
     15use AppConfig qw(ARGCOUNT_HASH);
    1616
    1717sub pb_init {
     
    2424                            CREATE => 1,
    2525                            DEBUG => 0,
     26                            GLOBAL => {
     27                                # Each conf item is a hash
     28                                ARGCOUNT => AppConfig::ARGCOUNT_HASH
     29                            }
    2630                        });
    27 $config->define("pbroot" => { ARGCOUNT => ARGCOUNT_ONE, EXPAND => EXPAND_ALL });
    28 $config->define("cvsroot" => { ARGCOUNT => ARGCOUNT_ONE });
    29 $config->define("defpkgdir" => { ARGCOUNT => ARGCOUNT_HASH });
    30 $config->define("extpkgdir" => { ARGCOUNT => ARGCOUNT_HASH });
    31 $config->define("version" => { ARGCOUNT => ARGCOUNT_HASH });
    32 $config->define("filteredfiles" => { ARGCOUNT => ARGCOUNT_LIST });
    33 
    3431$config->file($conffile);
    3532
     
    3734# needs at least 2 levels of dir as in the upper
    3835# other dirs will be created and used
    39 $ENV{'PBROOT'} = $config->get("pbroot") || die "Unable to find pbroot in $conffile";
    40 
    41 # If CVS, gives the way to login
    42 $ENV{'CVSROOT'} = $config->get("cvsroot");
     36$ptr = $config->get("param");
     37%param = %$ptr;
    4338
    4439# List of pkg to build by default
     
    5651# List of files to filter
    5752$ptr = $config->get("filteredfiles");
    58 @filteredfiles = @$ptr;
     53%filteredfiles = %$ptr;
    5954
    6055}
Note: See TracChangeset for help on using the changeset viewer.