[6] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # Project Builder configuration file
|
---|
| 4 | # For project pb ;-)
|
---|
| 5 | #
|
---|
| 6 | # $Id$
|
---|
| 7 | #
|
---|
| 8 | use strict;
|
---|
| 9 | use Exporter();
|
---|
| 10 | use vars qw(@ISA @EXPORT_OK);
|
---|
| 11 | @ISA = qw(Exporter);
|
---|
| 12 | # global vars are here
|
---|
[15] | 13 | @EXPORT_OK = qw(%defpkgdir %extpkgdir %version @filteredfiles &pb_init);
|
---|
[6] | 14 | use vars @EXPORT_OK;
|
---|
[7] | 15 | use AppConfig qw(ARGCOUNT_ONE ARGCOUNT_HASH ARGCOUNT_LIST EXPAND_ALL);
|
---|
[6] | 16 |
|
---|
| 17 | sub pb_init {
|
---|
| 18 |
|
---|
| 19 | my $conffile = shift;
|
---|
[7] | 20 | my $ptr;
|
---|
[6] | 21 |
|
---|
| 22 | my $config = AppConfig->new({
|
---|
| 23 | # Auto Create variables mentioned in Conf file
|
---|
| 24 | CREATE => 1,
|
---|
| 25 | DEBUG => 0,
|
---|
| 26 | });
|
---|
[7] | 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 });
|
---|
[8] | 31 | $config->define("version" => { ARGCOUNT => ARGCOUNT_HASH });
|
---|
[15] | 32 | $config->define("filteredfiles" => { ARGCOUNT => ARGCOUNT_LIST });
|
---|
[7] | 33 |
|
---|
[6] | 34 | $config->file($conffile);
|
---|
| 35 |
|
---|
| 36 | # Root of the project to build
|
---|
| 37 | # needs at least 2 levels of dir as in the upper
|
---|
| 38 | # other dirs will be created and used
|
---|
[7] | 39 | $ENV{'PBROOT'} = $config->get("pbroot") || die "Unable to find pbroot in $conffile";
|
---|
[6] | 40 |
|
---|
| 41 | # If CVS, gives the way to login
|
---|
| 42 | $ENV{'CVSROOT'} = $config->get("cvsroot");
|
---|
| 43 |
|
---|
| 44 | # List of pkg to build by default
|
---|
[7] | 45 | $ptr = $config->get("defpkgdir") || die "Unable to find defpkgdir in $conffile";
|
---|
| 46 | %defpkgdir = %$ptr;
|
---|
[6] | 47 |
|
---|
| 48 | # List of additional pkg to build when all is called
|
---|
[7] | 49 | $ptr = $config->get("extpkgdir");
|
---|
| 50 | %extpkgdir = %$ptr;
|
---|
[6] | 51 |
|
---|
| 52 | # Valid version names
|
---|
[7] | 53 | $ptr = $config->get("version");
|
---|
[8] | 54 | %version = %$ptr;
|
---|
[6] | 55 |
|
---|
[15] | 56 | # List of files to filter
|
---|
| 57 | $ptr = $config->get("filteredfiles");
|
---|
| 58 | @filteredfiles = @$ptr;
|
---|
| 59 |
|
---|
[6] | 60 | }
|
---|
| 61 | 1;
|
---|