source: ProjectBuilder/devel/pb/lib/pb.pm@ 18

Last change on this file since 18 was 18, checked in by Bruno Cornec, 17 years ago

cms2build roughly working

File size: 1.3 KB
Line 
1#!/usr/bin/perl -w
2#
3# Project Builder configuration file handler
4# For project pb ;-)
5#
6# $Id$
7#
8use strict;
9use AppConfig qw(ARGCOUNT_HASH);
10
11sub pb_init {
12
13my $conffile = shift;
14my $ptr;
15
16my $config = AppConfig->new({
17 # Auto Create variables mentioned in Conf file
18 CREATE => 1,
19 DEBUG => 0,
20 GLOBAL => {
21 # Each conf item is a hash
22 ARGCOUNT => AppConfig::ARGCOUNT_HASH
23 }
24 });
25$config->file($conffile);
26
27# Root of the project to build
28# needs at least 2 levels of dir as in the upper
29# other dirs will be created and used
30
31# main parameter hash (mandatory)
32$ptr = $config->get("confparam") || die "Unable to find confparam in $conffile";
33%confparam = %$ptr;
34
35# List of pkg to build by default (mandatory)
36$ptr = $config->get("defpkgdir") || die "Unable to find defpkgdir in $conffile";
37%defpkgdir = %$ptr;
38
39# List of additional pkg to build when all is called (optional)
40$ptr = $config->get("extpkgdir");
41if (not defined $ptr) {
42 %extpkgdir = ();
43} else {
44 %extpkgdir = %$ptr;
45}
46
47# Valid version names (optional)
48$ptr = $config->get("version");
49if (not defined $ptr) {
50 %version = ();
51} else {
52 %version = %$ptr;
53}
54
55# List of files to filter (optional)
56$ptr = $config->get("filteredfiles");
57if (not defined $ptr) {
58 %filteredfiles = ();
59} else {
60 %filteredfiles = %$ptr;
61}
62
63}
641;
Note: See TracBrowser for help on using the repository browser.