Changeset 7 in ProjectBuilder for devel/pb/lib/pb.pm
- Timestamp:
- Jul 29, 2007, 1:55:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/lib/pb.pm
r6 r7 13 13 @EXPORT_OK = qw(%defpkgdir %extpkgdir @version &pb_init); 14 14 use vars @EXPORT_OK; 15 use AppConfig ;15 use AppConfig qw(ARGCOUNT_ONE ARGCOUNT_HASH ARGCOUNT_LIST EXPAND_ALL); 16 16 17 17 sub pb_init { 18 18 19 19 my $conffile = shift; 20 my $ptr; 20 21 21 22 my $config = AppConfig->new({ … … 23 24 CREATE => 1, 24 25 DEBUG => 0, 25 GLOBAL => {26 # Each conf item has one single parameter27 ARGCOUNT => AppConfig::ARGCOUNT_ONE28 }29 26 }); 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_LIST }); 32 30 33 $config->file($conffile); 31 34 … … 33 36 # needs at least 2 levels of dir as in the upper 34 37 # other dirs will be created and used 35 $ENV{'PBROOT'} = $config->get("pb proj");38 $ENV{'PBROOT'} = $config->get("pbroot") || die "Unable to find pbroot in $conffile"; 36 39 37 40 # If CVS, gives the way to login … … 39 42 40 43 # List of pkg to build by default 41 %defpkgdir = $config->get("defpkgdir"); 44 $ptr = $config->get("defpkgdir") || die "Unable to find defpkgdir in $conffile"; 45 %defpkgdir = %$ptr; 42 46 43 47 # List of additional pkg to build when all is called 44 %extpkgdir = $config->get("extpkgdir"); 48 $ptr = $config->get("extpkgdir"); 49 %extpkgdir = %$ptr; 45 50 46 51 # Valid version names 47 @version = $config->get("version"); 52 $ptr = $config->get("version"); 53 @version = @$ptr; 48 54 49 55 }
Note:
See TracChangeset
for help on using the changeset viewer.