Changeset 2250 in ProjectBuilder


Ignore:
Timestamp:
Aug 30, 2017, 5:07:29 PM (7 years ago)
Author:
Bruno Cornec
Message:

Doc fixes mostly

Location:
devel/pb-modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.yml

    r2249 r2250  
     1%YAML 1.0
     2---
    13# $Id$
    24#
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r2249 r2250  
    7070to allow for overwrite to work:
    7171
     72For recent versions of pb (>= 0.15):
     731. /usr/share/pb/pb.yml     - the read-only system conf file provided by install
     742. /etc/pb/pb.yml           - the same global conf file given to the sysadmin in order to make system wide modifications
     753. /path/to/project.yml     - Configuration file for the project we're building for
     764. /vm|vepath/to/.pbrc.yml  - configuration file for VM, VE or RM specific parameters. Cumulative should be orthogonal
     775. $HOME/.pbrc.yml          - user's configuration file
     78
     79For versions of pb up to 0.14:
    72801. /usr/share/pb/pb.conf    - the read-only system conf file provided by install
    73812. /etc/pb/pb.conf          - the same global conf file given to the sysadmin in order to make system wide modifications
     
    75834. /(vm|ve|rm)path/to/.pbrc - configuration file for VM, VE or RM specific parameters. Cumulative should be orthogonal
    76845. $HOME/.pbrc              - user's configuration file
     85
     86The format of the configuration file is as follows:
     87
     88For recent versions of pb (>= 0.15):
     89YAML format is now used - The version of the configuration files is
     90
     91Supposing the file is called "$ENV{'HOME'}/.pbrc.yml", containing the following:
     92
     93  $ cat $HOME/.pbrc.yml
     94  ---
     95    pbver:
     96      - pb: 3
     97      - default: 1
     98    pblist:
     99      - pb: 12,25
     100
     101calling it like this:
     102
     103  my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc.yml","pbver","pblist");
     104
     105will allow to get the mapping:
     106
     107  $k1->{'pb'} contains 3
     108  $k1->{'default'} contains 1
     109  $k2->{'pb'} contains 12,25
     110
     111For versions of pb up to 0.14:
     112An own format was used - The version of the configuration files is 0
     113
     114key tag = value1,value2,...
     115
     116Supposing the file is called "$ENV{'HOME'}/.pbrc", containing the following:
     117
     118  $ cat $HOME/.pbrc
     119  pbver pb = 3
     120  pbver default = 1
     121  pblist pb = 12,25
     122
     123calling it like this:
     124
     125  my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc","pbver","pblist");
     126
     127will allow to get the mapping:
     128
     129  $k1->{'pb'}  contains 3
     130  $k1->{'default'} contains 1
     131  $k2->{'pb'} contains 12,25
     132
     133Valid chars for keys and tags are letters, numbers, '-' and '_'.
    77134
    78135=over 4
     
    114171=item B<pb_conf_cache>
    115172
    116 This function caches the configuration file content passed as first parameter into the a hash passed in second parameter
     173This function caches the configuration file content passed as first parameter into the hash passed in second parameter
    117174It returns the modified hash
    118175Can be used in correlation with the %h hash to store permanently values or not if temporarily.
     
    203260If that file doesn't exist, it returns undef.
    204261
    205 The format of the configuration file is as follows:
    206 
    207 key tag = value1,value2,...
    208 
    209 Supposing the file is called "$ENV{'HOME'}/.pbrc", containing the following:
    210 
    211   $ cat $HOME/.pbrc
    212   pbver pb = 3
    213   pbver default = 1
    214   pblist pb = 12,25
    215 
    216 calling it like this:
    217 
    218   my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc","pbver","pblist");
    219 
    220 will allow to get the mapping:
    221 
    222   $k1->{'pb'}  contains 3
    223   $k1->{'default'} contains 1
    224   $k2->{'pb'} contains 12,25
    225 
    226 Valid chars for keys and tags are letters, numbers, '-' and '_'.
    227 
    228262The file read is forgotten after its usage. If you want permanent caching of the data, use pb_conf_add then pb_conf_get
    229263
     
    340374
    341375This function returns a table, corresponding to a set of values queried in the %h hash or undef if it doen't exist. It takes a table of keys as an input parameter.
    342 
    343 The format of the configurations file is as follows:
    344 
    345 key tag = value1,value2,...
    346 
    347 It will gather the values from all the configurations files passed to pb_conf_add, and return the values for the keys
    348 
    349   $ cat $HOME/.pbrc
    350   pbver pb = 1
    351   pblist pb = 4
    352   $ cat $HOME/.pbrc2
    353   pbver pb = 3
    354   pblist default = 5
    355 
    356 calling it like this:
    357 
    358   pb_conf_add("$HOME/.pbrc","$HOME/.pbrc2");
    359   my ($k1, $k2) = pb_conf_get_if("pbver","pblist");
    360 
    361 will allow to get the mapping:
    362 
    363   $k1->{'pb'} contains 3
    364   $k2->{'pb'} contains 4
    365 
    366 Valid chars for keys and tags are letters, numbers, '-' and '_'.
    367376
    368377=cut
Note: See TracChangeset for help on using the changeset viewer.