- Timestamp:
- Apr 19, 2008, 12:46:44 AM (17 years ago)
- Location:
- devel/pb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/Makefile.PL
r391 r396 18 18 EXE_FILES => [ qw( bin/pb bin/pbg bin/pbvi bin/pbdistrocheck ) ], 19 19 MAN1PODS => { 'bin/pb' => '$(INST_MAN1DIR)/pb.$(MAN1EXT)', }, 20 MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)', }, 20 MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)', 21 'lib/ProjectBuilder/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', }, 21 22 ); -
devel/pb/lib/ProjectBuilder/Base.pm
r395 r396 97 97 98 98 Internal mkdir -p function. Forces mode to 755. Supports multiple parameters. 99 Based in File::Path mkpath. 99 100 Based on File::Path mkpath. 100 101 101 102 =cut … … 107 108 } 108 109 109 =item B<pb_ mkdir_p>110 =item B<pb_rm_rf> 110 111 111 112 Internal rm -rf function. Supports multiple parameters. 112 Based in File::Path rmtree. 113 114 Based on File::Path rmtree. 113 115 114 116 =cut … … 129 131 The second parameter is the message to print on screen. If none is given, then the command is printed. 130 132 This function returns the result the return value of the system command. 133 131 134 If no error reported, it prints OK on the screen, just after the message. Else it prints the errors generated. 132 135 … … 169 172 Supposing the file is called "$ENV{'HOME'}/.pbrc", containing the following: 170 173 171 $ cat $HOME/.pbrc172 pbver pb = 3173 pbver default = 1174 pblist pb = 12,25174 $ cat $HOME/.pbrc 175 pbver pb = 3 176 pbver default = 1 177 pblist pb = 12,25 175 178 176 179 calling it like this: 177 180 178 my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc","pbver","pblist"); 179 180 will allow to get the mapping 181 $k1->{'pb'} contains 3 182 $ka->{'default'} contains 1 183 $k2->{'pb'} contains 12,25 181 my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc","pbver","pblist"); 182 183 will allow to get the mapping: 184 185 $k1->{'pb'} contains 3 186 $ka->{'default'} contains 1 187 $k2->{'pb'} contains 12,25 184 188 185 189 Valid chars for keys and tags are letters, numbers, '-' and '_'. … … 231 235 232 236 A URI has the format protocol://[ac@]host[:port][path[?query][#fragment]]. 237 233 238 Cf man URI. 234 239 … … 275 280 The second parameter is a pointer on a file descriptor used to print the log info. 276 281 282 As an example, if you set the debug level to 2 in that function, every call to pb_log which contains a value less or equal than 2 will be printed. Calls with a value greater than 2 won't be printed. 283 284 The call to B<pb_log_init> is typically done after getting a parameter on the CLI indicating the level of verbosity expected. 285 277 286 =cut 278 287 … … 284 293 } 285 294 295 =item B<pb_log> 296 297 This function logs the messages passed as the second parameter if the value passed as first parameter is lesser or equal than the value passed to the B<pb_log_init> function. 298 299 Here is a usage example: 300 301 pb_log_init(2,\*STDERR); 302 pb_log(1,"Hello World 1\n"); 303 pb_log(2,"Hello World 2\n"); 304 pb_log(3,"Hello World 3\n"); 305 306 will print: 307 308 Hello World 1 309 Hello World 2 310 311 =cut 312 286 313 sub pb_log { 287 314 … … 292 319 } 293 320 294 # cat equivalent function 321 =item B<pb_display_file> 322 323 This function print the content of the file passed in parameter. 324 325 This is a cat equivalent function. 326 327 =cut 328 295 329 sub pb_display_file { 296 330 … … 300 334 printf "%s\n",pb_get_content($file); 301 335 } 336 337 =item B<pb_get_content> 338 339 This function returns the content of the file passed in parameter. 340 341 =cut 302 342 303 343 # get content of a file in a variable
Note:
See TracChangeset
for help on using the changeset viewer.