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