Last change
on this file since 8 was 8, checked in by Bruno Cornec, 17 years ago |
Basic function works (conf file read and interpret)
|
File size:
1.4 KB
|
Rev | Line | |
---|
[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
|
---|
[8] | 13 | @EXPORT_OK = qw(%defpkgdir %extpkgdir %version &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 });
|
---|
[7] | 32 |
|
---|
[6] | 33 | $config->file($conffile);
|
---|
| 34 |
|
---|
| 35 | # Root of the project to build
|
---|
| 36 | # needs at least 2 levels of dir as in the upper
|
---|
| 37 | # other dirs will be created and used
|
---|
[7] | 38 | $ENV{'PBROOT'} = $config->get("pbroot") || die "Unable to find pbroot in $conffile";
|
---|
[6] | 39 |
|
---|
| 40 | # If CVS, gives the way to login
|
---|
| 41 | $ENV{'CVSROOT'} = $config->get("cvsroot");
|
---|
| 42 |
|
---|
| 43 | # List of pkg to build by default
|
---|
[7] | 44 | $ptr = $config->get("defpkgdir") || die "Unable to find defpkgdir in $conffile";
|
---|
| 45 | %defpkgdir = %$ptr;
|
---|
[6] | 46 |
|
---|
| 47 | # List of additional pkg to build when all is called
|
---|
[7] | 48 | $ptr = $config->get("extpkgdir");
|
---|
| 49 | %extpkgdir = %$ptr;
|
---|
[6] | 50 |
|
---|
| 51 | # Valid version names
|
---|
[7] | 52 | $ptr = $config->get("version");
|
---|
[8] | 53 | %version = %$ptr;
|
---|
[6] | 54 |
|
---|
| 55 | }
|
---|
| 56 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.