Changeset 2250 in ProjectBuilder for devel/pb-modules
- Timestamp:
- Aug 30, 2017, 5:07:29 PM (8 years ago)
- Location:
- devel/pb-modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.yml
r2249 r2250 1 %YAML 1.0 2 --- 1 3 # $Id$ 2 4 # -
devel/pb-modules/lib/ProjectBuilder/Conf.pm
r2249 r2250 70 70 to allow for overwrite to work: 71 71 72 For recent versions of pb (>= 0.15): 73 1. /usr/share/pb/pb.yml - the read-only system conf file provided by install 74 2. /etc/pb/pb.yml - the same global conf file given to the sysadmin in order to make system wide modifications 75 3. /path/to/project.yml - Configuration file for the project we're building for 76 4. /vm|vepath/to/.pbrc.yml - configuration file for VM, VE or RM specific parameters. Cumulative should be orthogonal 77 5. $HOME/.pbrc.yml - user's configuration file 78 79 For versions of pb up to 0.14: 72 80 1. /usr/share/pb/pb.conf - the read-only system conf file provided by install 73 81 2. /etc/pb/pb.conf - the same global conf file given to the sysadmin in order to make system wide modifications … … 75 83 4. /(vm|ve|rm)path/to/.pbrc - configuration file for VM, VE or RM specific parameters. Cumulative should be orthogonal 76 84 5. $HOME/.pbrc - user's configuration file 85 86 The format of the configuration file is as follows: 87 88 For recent versions of pb (>= 0.15): 89 YAML format is now used - The version of the configuration files is 90 91 Supposing 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 101 calling it like this: 102 103 my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc.yml","pbver","pblist"); 104 105 will allow to get the mapping: 106 107 $k1->{'pb'} contains 3 108 $k1->{'default'} contains 1 109 $k2->{'pb'} contains 12,25 110 111 For versions of pb up to 0.14: 112 An own format was used - The version of the configuration files is 0 113 114 key tag = value1,value2,... 115 116 Supposing 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 123 calling it like this: 124 125 my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc","pbver","pblist"); 126 127 will allow to get the mapping: 128 129 $k1->{'pb'} contains 3 130 $k1->{'default'} contains 1 131 $k2->{'pb'} contains 12,25 132 133 Valid chars for keys and tags are letters, numbers, '-' and '_'. 77 134 78 135 =over 4 … … 114 171 =item B<pb_conf_cache> 115 172 116 This function caches the configuration file content passed as first parameter into the ahash passed in second parameter173 This function caches the configuration file content passed as first parameter into the hash passed in second parameter 117 174 It returns the modified hash 118 175 Can be used in correlation with the %h hash to store permanently values or not if temporarily. … … 203 260 If that file doesn't exist, it returns undef. 204 261 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/.pbrc212 pbver pb = 3213 pbver default = 1214 pblist pb = 12,25215 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 3223 $k1->{'default'} contains 1224 $k2->{'pb'} contains 12,25225 226 Valid chars for keys and tags are letters, numbers, '-' and '_'.227 228 262 The file read is forgotten after its usage. If you want permanent caching of the data, use pb_conf_add then pb_conf_get 229 263 … … 340 374 341 375 This 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 keys348 349 $ cat $HOME/.pbrc350 pbver pb = 1351 pblist pb = 4352 $ cat $HOME/.pbrc2353 pbver pb = 3354 pblist default = 5355 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 3364 $k2->{'pb'} contains 4365 366 Valid chars for keys and tags are letters, numbers, '-' and '_'.367 376 368 377 =cut
Note:
See TracChangeset
for help on using the changeset viewer.