Ignore:
Timestamp:
Aug 5, 2008, 6:00:38 PM (11 years ago)
Author:
bruno
Message:
  • pb_conf_init introduced to allow projects using pb functions to setup the PBPROJ variable correctly, even when the code is expanded with macros.
  • doc fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r424 r505  
    5151=over 4
    5252
     53=item B<pb_conf_init>
     54
     55This function setup the environment PBPROJ for project-builder function usage rfom other projects.
     56The first parameter is the project name.
     57It sets up environement variables (PBPROJ)
     58
     59=cut
     60
     61sub pb_conf_init {
     62
     63my $proj=shift || undef;
     64
     65if (defined $proj) {
     66    $ENV{'PBPROJ'} = $proj;
     67} else {
     68    $ENV{'PBPROJ'} = "default";
     69}
     70}
     71
     72
     73
    5374=item B<pb_conf_add>
    5475
     
    141162key tag = value1,value2,...
    142163
    143 It will gather the values from all the configurations files passed to pb_conf_init, and return the values for the keys, taking in account the order of conf files, to manage overloading.
     164It will gather the values from all the configurations files passed to pb_conf_add, and return the values for the keys, taking in account the order of conf files, to manage overloading.
    144165
    145166  $ cat $HOME/.pbrc
     
    152173calling it like this:
    153174
    154   pb_conf_init("$HOME/.pbrc","$HOME/.pbrc2");
     175  pb_conf_add("$HOME/.pbrc","$HOME/.pbrc2");
    155176  my ($k1, $k2) = pb_conf_get_if("pbver","pblist");
    156177
Note: See TracChangeset for help on using the changeset viewer.