Changeset 505 in ProjectBuilder


Ignore:
Timestamp:
Aug 5, 2008, 6:00:38 PM (16 years ago)
Author:
Bruno Cornec
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
Location:
devel
Files:
2 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
  • devel/pb/lib/ProjectBuilder/Env.pm

    r500 r505  
    5050
    5151This function setup the environment for project-builder.
    52 The first parameter is the project if givent on the command line.
     52The first parameter is the project if given on the command line.
    5353The second parameter is a flag indicating whether we should setup up the pbconf environment or not.
    54 The third parameter is the action passed to bp.
     54The third parameter is the action passed to pb.
    5555It sets up environement variables (PBETC, PBPROJ, PBDEFDIR, PBBUILDDIR, PBROOTDIR, PBDESTDIR, PBCONFDIR, PBPROJVER)
    5656
Note: See TracChangeset for help on using the changeset viewer.