source: devel/pb/lib/pb.pm @ 15

Last change on this file since 15 was 15, checked in by Bruno Cornec, 13 years ago

Begin to deal with filters

File size: 1.6 KB
Line 
1#!/usr/bin/perl -w
2#
3# Project Builder configuration file
4# For project pb ;-)
5#
6# $Id$
7#
8use strict;
9use Exporter();
10use vars qw(@ISA @EXPORT_OK);
11@ISA = qw(Exporter);
12# global vars are here
13@EXPORT_OK = qw(%defpkgdir %extpkgdir %version @filteredfiles &pb_init);
14use vars @EXPORT_OK;
15use AppConfig qw(ARGCOUNT_ONE ARGCOUNT_HASH ARGCOUNT_LIST EXPAND_ALL);
16
17sub pb_init {
18
19my $conffile = shift;
20my $ptr;
21
22my $config = AppConfig->new({
23                            # Auto Create variables mentioned in Conf file
24                            CREATE => 1,
25                            DEBUG => 0,
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_HASH });
32$config->define("filteredfiles" => { ARGCOUNT => ARGCOUNT_LIST });
33
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
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");
43
44# List of pkg to build by default
45$ptr = $config->get("defpkgdir") || die "Unable to find defpkgdir in $conffile";
46%defpkgdir = %$ptr;
47
48# List of additional pkg to build when all is called
49$ptr = $config->get("extpkgdir");
50%extpkgdir = %$ptr;
51
52# Valid version names
53$ptr = $config->get("version");
54%version = %$ptr;
55
56# List of files to filter
57$ptr = $config->get("filteredfiles");
58@filteredfiles = @$ptr;
59
60}
611;
Note: See TracBrowser for help on using the repository browser.