Commit f9f47a855808bb555d600feae53efe4228d727b9
- Diff rendering mode:
- inline
- side by side
probes/wget.pir
(3 / 1)
|   | |||
| 1 | 1 | # Copyright (C) 2009, Parrot Foundation. | |
| 2 | 2 | # $Id$ | |
| 3 | 3 | ||
| 4 | =begin | ||
| 5 | |||
| 4 | 6 | =head1 NAME | |
| 5 | 7 | ||
| 6 | 8 | wget.pir - HTTP client | |
| … | … | ||
| 17 | 17 | ||
| 18 | 18 | This is a very thin wrapper around Plumage::Downloader::save_url_to_file | |
| 19 | 19 | ||
| 20 | =cut | ||
| 20 | =end | ||
| 21 | 21 | ||
| 22 | 22 | .sub 'main' :main | |
| 23 | 23 | .param pmc argv |
src/lib/Glue.pir
(68 / 28)
|   | |||
| 2 | 2 | ||
| 3 | 3 | Glue.pir - Rakudo "glue" builtins (functions/globals) converted for NQP | |
| 4 | 4 | ||
| 5 | =begin | ||
| 5 | 6 | ||
| 6 | 7 | =head1 SYNOPSIS | |
| 7 | 8 | ||
| … | … | ||
| 62 | 62 | our $OSVER; | |
| 63 | 63 | ||
| 64 | 64 | ||
| 65 | =cut | ||
| 65 | =end | ||
| 66 | 66 | ||
| 67 | 67 | .namespace [] | |
| 68 | 68 | ||
| … | … | ||
| 70 | 70 | .include 'sysinfo.pasm' | |
| 71 | 71 | .include 'iglobals.pasm' | |
| 72 | 72 | ||
| 73 | =begin | ||
| 73 | 74 | ||
| 74 | 75 | =head1 DESCRIPTION | |
| 75 | 76 | ||
| … | … | ||
| 84 | 84 | the status code of the spawned process, which is equal the the result | |
| 85 | 85 | of the waitpid system call, right bitshifted by 8. | |
| 86 | 86 | ||
| 87 | =cut | ||
| 87 | =end | ||
| 88 | 88 | ||
| 89 | 89 | .sub 'run' | |
| 90 | 90 | .param pmc command_and_args :slurpy | |
| … | … | ||
| 99 | 99 | .return (status) | |
| 100 | 100 | .end | |
| 101 | 101 | ||
| 102 | =begin | ||
| 102 | 103 | ||
| 103 | 104 | =item $success := do_run($command, $and, $args, ...) | |
| 104 | 105 | ||
| … | … | ||
| 107 | 107 | arguments as a new process; return 1 if the process exited successfully, or | |
| 108 | 108 | 0 if not. | |
| 109 | 109 | ||
| 110 | =cut | ||
| 110 | =end | ||
| 111 | 111 | ||
| 112 | 112 | .sub 'do_run' | |
| 113 | 113 | .param pmc command_and_args :slurpy | |
| … | … | ||
| 125 | 125 | .return (0) | |
| 126 | 126 | .end | |
| 127 | 127 | ||
| 128 | =begin | ||
| 128 | 129 | ||
| 129 | 130 | =item $output := qx($command, $and, $args, ...) | |
| 130 | 131 | ||
| … | … | ||
| 134 | 134 | ||
| 135 | 135 | B<WARNING>: Parrot currently implements this B<INSECURELY>! | |
| 136 | 136 | ||
| 137 | =cut | ||
| 137 | =end | ||
| 138 | 138 | ||
| 139 | 139 | .sub 'qx' | |
| 140 | 140 | .param pmc command_and_args :slurpy | |
| … | … | ||
| 159 | 159 | die $S0 | |
| 160 | 160 | .end | |
| 161 | 161 | ||
| 162 | =begin | ||
| 162 | 163 | ||
| 163 | 164 | =item die($message) | |
| 164 | 165 | ||
| 165 | 166 | Kill program, reporting error C<$message>. | |
| 166 | 167 | ||
| 167 | =cut | ||
| 168 | =end | ||
| 168 | 169 | ||
| 169 | 170 | .sub 'die' | |
| 170 | 171 | .param string message | |
| … | … | ||
| 173 | 173 | die message | |
| 174 | 174 | .end | |
| 175 | 175 | ||
| 176 | =begin | ||
| 176 | 177 | ||
| 177 | 178 | =item $ret := try(&code, @args [, &handler]) | |
| 178 | 179 | ||
| … | … | ||
| 186 | 186 | catch($ex) { $ret := &handler ?? &handler($ex, &code, @args) !! 0 } | |
| 187 | 187 | return $ret; | |
| 188 | 188 | ||
| 189 | =cut | ||
| 189 | =end | ||
| 190 | 190 | ||
| 191 | 191 | .sub 'try' | |
| 192 | 192 | .param pmc code | |
| … | … | ||
| 211 | 211 | .return (0) | |
| 212 | 212 | .end | |
| 213 | 213 | ||
| 214 | =begin | ||
| 214 | 215 | ||
| 215 | 216 | =item @keys := keys(%hash) | |
| 216 | 217 | ||
| 217 | 218 | Return an array containing the keys of the C<%hash>. | |
| 218 | 219 | ||
| 219 | =cut | ||
| 220 | =end | ||
| 220 | 221 | ||
| 221 | 222 | .sub 'keys' | |
| 222 | 223 | .param pmc hash | |
| … | … | ||
| 238 | 238 | .return(key_list) | |
| 239 | 239 | .end | |
| 240 | 240 | ||
| 241 | =begin | ||
| 241 | 242 | ||
| 242 | 243 | =item $found := exists(%hash, $key) | |
| 243 | 244 | ||
| 244 | 245 | Determine if C<$key> exists in C<%hash>, returning a true value if so, and a | |
| 245 | 246 | false value if not. | |
| 246 | 247 | ||
| 247 | =cut | ||
| 248 | =end | ||
| 248 | 249 | ||
| 249 | 250 | .sub 'exists' | |
| 250 | 251 | .param pmc hash | |
| … | … | ||
| 256 | 256 | .return($I0) | |
| 257 | 257 | .end | |
| 258 | 258 | ||
| 259 | =begin | ||
| 259 | 260 | ||
| 260 | 261 | =item $does_role := does($object, $role) | |
| 261 | 262 | ||
| 262 | 263 | Determine if C<$object> does the C<$role>, returning a true value if so, and a | |
| 263 | 264 | false value if not. | |
| 264 | 265 | ||
| 265 | =cut | ||
| 266 | =end | ||
| 266 | 267 | ||
| 267 | 268 | .sub 'does' | |
| 268 | 269 | .param pmc object | |
| … | … | ||
| 274 | 274 | .return($I0) | |
| 275 | 275 | .end | |
| 276 | 276 | ||
| 277 | =begin | ||
| 277 | 278 | ||
| 278 | 279 | =item $contents := slurp($filename) | |
| 279 | 280 | ||
| 280 | 281 | Read the C<$contents> of a file as a single string. | |
| 281 | 282 | ||
| 282 | =cut | ||
| 283 | =end | ||
| 283 | 284 | ||
| 284 | 285 | .sub 'slurp' | |
| 285 | 286 | .param string filename | |
| … | … | ||
| 292 | 292 | .return(contents) | |
| 293 | 293 | .end | |
| 294 | 294 | ||
| 295 | =begin | ||
| 295 | 296 | ||
| 296 | 297 | =item spew($filename, $contents) | |
| 297 | 298 | ||
| 298 | 299 | Write the string C<$contents> to a file. | |
| 299 | 300 | ||
| 300 | =cut | ||
| 301 | =end | ||
| 301 | 302 | ||
| 302 | 303 | .sub 'spew' | |
| 303 | 304 | .param string filename | |
| … | … | ||
| 309 | 309 | close $P0 | |
| 310 | 310 | .end | |
| 311 | 311 | ||
| 312 | =begin | ||
| 312 | 313 | ||
| 313 | 314 | =item append($filename, $contents) | |
| 314 | 315 | ||
| 315 | 316 | Append the string C<$contents> to a file. | |
| 316 | 317 | ||
| 317 | =cut | ||
| 318 | =end | ||
| 318 | 319 | ||
| 319 | 320 | .sub 'append' | |
| 320 | 321 | .param string filename | |
| … | … | ||
| 326 | 326 | close $P0 | |
| 327 | 327 | .end | |
| 328 | 328 | ||
| 329 | =begin | ||
| 329 | 330 | ||
| 330 | 331 | =item $regex_object := rx($regex_source) | |
| 331 | 332 | ||
| … | … | ||
| 334 | 334 | Perl 6 Regex) into a C<$regex_object>, suitable for using in C<match()> and | |
| 335 | 335 | C<subst()>. | |
| 336 | 336 | ||
| 337 | =cut | ||
| 337 | =end | ||
| 338 | 338 | ||
| 339 | 339 | .sub 'rx' | |
| 340 | 340 | .param string source | |
| … | … | ||
| 346 | 346 | .return(object) | |
| 347 | 347 | .end | |
| 348 | 348 | ||
| 349 | =begin | ||
| 350 | |||
| 349 | 351 | =item @matches := all_matches($regex, $text) | |
| 350 | 352 | ||
| 351 | 353 | Find all matches (C<:g> style, not C<:exhaustive>) for C<$regex> in the | |
| 352 | 354 | C<$text>. The C<$regex> must be a regex object returned by C<rx()>. | |
| 353 | 355 | ||
| 354 | =cut | ||
| 356 | =end | ||
| 355 | 357 | ||
| 356 | 358 | .sub 'all_matches' | |
| 357 | 359 | .param pmc regex | |
| … | … | ||
| 378 | 378 | .return(matches) | |
| 379 | 379 | .end | |
| 380 | 380 | ||
| 381 | =begin | ||
| 381 | 382 | ||
| 382 | 383 | =item $edited := subst($original, $regex, $replacement) | |
| 383 | 384 | ||
| … | … | ||
| 390 | 390 | with each match object in turn, and must return the proper replacement string | |
| 391 | 391 | for that match. | |
| 392 | 392 | ||
| 393 | =cut | ||
| 393 | =end | ||
| 394 | 394 | ||
| 395 | 395 | .sub 'subst' | |
| 396 | 396 | .param string original | |
| … | … | ||
| 438 | 438 | .return(edited) | |
| 439 | 439 | .end | |
| 440 | 440 | ||
| 441 | =begin | ||
| 442 | |||
| 441 | 443 | =item chdir($path) | |
| 442 | 444 | ||
| 443 | 445 | Change the current working directory to the specified C<$path>. | |
| 444 | 446 | ||
| 445 | =cut | ||
| 447 | =end | ||
| 446 | 448 | ||
| 447 | 449 | .sub 'chdir' | |
| 448 | 450 | .param string path | |
| … | … | ||
| 454 | 454 | os.'chdir'(path) | |
| 455 | 455 | .end | |
| 456 | 456 | ||
| 457 | =begin | ||
| 458 | |||
| 457 | 459 | =item $path := cwd() | |
| 458 | 460 | ||
| 459 | 461 | Return the current working directory. | |
| 460 | 462 | ||
| 461 | =cut | ||
| 463 | =end | ||
| 462 | 464 | ||
| 463 | 465 | .sub 'cwd' | |
| 464 | 466 | .local pmc os | |
| … | … | ||
| 472 | 472 | .return(path) | |
| 473 | 473 | .end | |
| 474 | 474 | ||
| 475 | =begin | ||
| 476 | |||
| 475 | 477 | =item mkdir($path [, $mode]) | |
| 476 | 478 | ||
| 477 | 479 | Create a directory specified by C<$path> with mode C<$mode>. C<$mode> is | |
| 478 | 480 | optional and defaults to octal C<777> (full permissions) if absent. C<$mode> | |
| 479 | 481 | is modified by the user's current C<umask> as usual. | |
| 480 | 482 | ||
| 481 | =cut | ||
| 483 | =end | ||
| 482 | 484 | ||
| 483 | 485 | .sub 'mkdir' | |
| 484 | 486 | .param string path | |
| … | … | ||
| 496 | 496 | os.'mkdir'(path, mode) | |
| 497 | 497 | .end | |
| 498 | 498 | ||
| 499 | =begin | ||
| 500 | |||
| 499 | 501 | =item unlink($path) | |
| 500 | 502 | ||
| 501 | 503 | Unlink (delete) a file or empty directory named C<$path> in the filesystem. | |
| 502 | 504 | ||
| 503 | =cut | ||
| 505 | =end | ||
| 504 | 506 | ||
| 505 | 507 | .sub 'unlink' | |
| 506 | 508 | .param string path | |
| … | … | ||
| 512 | 512 | os.'rm'(path) | |
| 513 | 513 | .end | |
| 514 | 514 | ||
| 515 | =begin | ||
| 516 | |||
| 515 | 517 | =item @info := stat($path) | |
| 516 | 518 | ||
| 517 | 519 | Returns a 13-item list of information about the given C<$path>, as in Perl 5. | |
| 518 | 520 | (See C<perldoc -f stat> for more details.) | |
| 519 | 521 | ||
| 520 | =cut | ||
| 522 | =end | ||
| 521 | 523 | ||
| 522 | 524 | .sub 'stat' | |
| 523 | 525 | .param string path | |
| … | … | ||
| 531 | 531 | .return (stat_list) | |
| 532 | 532 | .end | |
| 533 | 533 | ||
| 534 | =begin | ||
| 535 | |||
| 534 | 536 | =item $found := path_exists($path); | |
| 535 | 537 | ||
| 536 | 538 | Return a true value if the C<$path> exists on the filesystem, or a false | |
| 537 | 539 | value if not. | |
| 538 | 540 | ||
| 539 | =cut | ||
| 541 | =end | ||
| 540 | 542 | ||
| 541 | 543 | .sub 'path_exists' | |
| 542 | 544 | .param string path | |
| … | … | ||
| 554 | 554 | .return (0) | |
| 555 | 555 | .end | |
| 556 | 556 | ||
| 557 | =begin | ||
| 558 | |||
| 557 | 559 | =item @names := readdir($directory) | |
| 558 | 560 | ||
| 559 | 561 | List the names of all entries in the C<$directory>. | |
| 560 | 562 | ||
| 561 | =cut | ||
| 563 | =end | ||
| 562 | 564 | ||
| 563 | 565 | .sub 'readdir' | |
| 564 | 566 | .param string dir | |
| … | … | ||
| 572 | 572 | .return (names) | |
| 573 | 573 | .end | |
| 574 | 574 | ||
| 575 | =begin | ||
| 576 | |||
| 575 | 577 | =item $path := fscat(@path_parts [, $filename]) | |
| 576 | 578 | ||
| 577 | 579 | Join C<@path_parts> and C<$filename> strings together with the appropriate | |
| … | … | ||
| 581 | 581 | trailing slash (though slashes inside the C<@path_parts> will not be removed, | |
| 582 | 582 | so don't do that). | |
| 583 | 583 | ||
| 584 | =cut | ||
| 584 | =end | ||
| 585 | 585 | ||
| 586 | 586 | .sub 'fscat' | |
| 587 | 587 | .param pmc parts | |
| … | … | ||
| 604 | 604 | .return (joined) | |
| 605 | 605 | .end | |
| 606 | 606 | ||
| 607 | =begin | ||
| 608 | |||
| 607 | 609 | =item $joined := join($delimiter, @strings) | |
| 608 | 610 | ||
| 609 | 611 | Join C<@strings> together with the specified C<$delimiter>. | |
| 610 | 612 | ||
| 611 | =cut | ||
| 613 | =end | ||
| 612 | 614 | ||
| 613 | 615 | .sub 'join' | |
| 614 | 616 | .param string delim | |
| … | … | ||
| 622 | 622 | .return (joined) | |
| 623 | 623 | .end | |
| 624 | 624 | ||
| 625 | =begin | ||
| 626 | |||
| 625 | 627 | =item @pieces := split($delimiter, $original) | |
| 626 | 628 | ||
| 627 | 629 | Split the C<$original> string with the specified C<$delimiter>, which is not | |
| 628 | 630 | included in the resulting C<@pieces>. | |
| 629 | 631 | ||
| 630 | =cut | ||
| 632 | =end | ||
| 631 | 633 | ||
| 632 | 634 | .sub 'split' | |
| 633 | 635 | .param string delim | |
| … | … | ||
| 641 | 641 | .return (pieces) | |
| 642 | 642 | .end | |
| 643 | 643 | ||
| 644 | =begin | ||
| 644 | 645 | ||
| 645 | 646 | =item @array := as_array($list, $of, $items, ...) | |
| 646 | 647 | ||
| 647 | 648 | Slurp the list of arguments into an array and return it. | |
| 648 | 649 | ||
| 649 | =cut | ||
| 650 | =end | ||
| 650 | 651 | ||
| 651 | 652 | .sub 'as_array' | |
| 652 | 653 | .param pmc items :slurpy | |
| … | … | ||
| 655 | 655 | .return (items) | |
| 656 | 656 | .end | |
| 657 | 657 | ||
| 658 | =begin | ||
| 658 | 659 | ||
| 659 | 660 | =item $result := call_flattened(&code, $mixed, @args, $list, ...) | |
| 660 | 661 | ||
| … | … | ||
| 669 | 669 | ||
| 670 | 670 | call_flattened(&code, as_array(@protected), @will_flatten) | |
| 671 | 671 | ||
| 672 | =cut | ||
| 672 | =end | ||
| 673 | 673 | ||
| 674 | 674 | .sub 'call_flattened' | |
| 675 | 675 | .param pmc code | |
| … | … | ||
| 698 | 698 | .tailcall code(flattened :flat) | |
| 699 | 699 | .end | |
| 700 | 700 | ||
| 701 | =begin | ||
| 702 | |||
| 701 | 703 | =back | |
| 702 | 704 | ||
| 703 | 705 | ||
| … | … | ||
| 733 | 733 | ||
| 734 | 734 | =back | |
| 735 | 735 | ||
| 736 | =cut | ||
| 736 | =end | ||
| 737 | 737 | ||
| 738 | 738 | .sub 'onload' :anon :load :init | |
| 739 | 739 | load_bytecode 'config.pbc' |
src/lib/Metadata.nqp
(11 / 5)
|   | |||
| 2 | 2 | ||
| 3 | 3 | Metadata.nqp - Metadata-handling functions for Plumage | |
| 4 | 4 | ||
| 5 | =begin | ||
| 5 | 6 | ||
| 6 | 7 | =head1 SYNOPSIS | |
| 7 | 8 | ||
| … | … | ||
| 17 | 17 | ||
| 18 | 18 | =head1 DESCRIPTION | |
| 19 | 19 | ||
| 20 | =cut | ||
| 20 | =end | ||
| 21 | 21 | ||
| 22 | 22 | our %CONF; | |
| 23 | 23 | our %ACTION; | |
| 24 | 24 | ||
| 25 | =begin | ||
| 26 | |||
| 25 | 27 | =head2 Functions | |
| 26 | 28 | ||
| 27 | 29 | =over 4 | |
| … | … | ||
| 34 | 34 | whether they are currently installed or not. Each name is suitable for passing | |
| 35 | 35 | to C<get_project_metadata()> to obtain more details. | |
| 36 | 36 | ||
| 37 | =cut | ||
| 37 | =end | ||
| 38 | 38 | ||
| 39 | 39 | sub get_project_list () { | |
| 40 | 40 | my @files := readdir(replace_config_strings(%CONF<plumage_metadata_dir>)); | |
| … | … | ||
| 51 | 51 | return @projects; | |
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | =begin | ||
| 54 | 55 | ||
| 55 | 56 | =item %info := get_project_metadata($project, $ignore_missing) | |
| 56 | 57 | ||
| … | … | ||
| 59 | 59 | such project is known, and also outputs an error message unless | |
| 60 | 60 | C<$ignore_missing> is true. | |
| 61 | 61 | ||
| 62 | =cut | ||
| 62 | =end | ||
| 63 | 63 | ||
| 64 | 64 | sub get_project_metadata ($project, $ignore_missing) { | |
| 65 | 65 | my $meta_dir := replace_config_strings(%CONF<plumage_metadata_dir>); | |
| … | … | ||
| 82 | 82 | return 0; | |
| 83 | 83 | } | |
| 84 | 84 | ||
| 85 | =begin | ||
| 85 | 86 | ||
| 86 | 87 | =item $is_valid := metadata_valid(%info) | |
| 87 | 88 | ||
| … | … | ||
| 91 | 91 | if not. Also outputs error messages and hints to the user for any problems | |
| 92 | 92 | found. | |
| 93 | 93 | ||
| 94 | =cut | ||
| 94 | =end | ||
| 95 | 95 | ||
| 96 | 96 | sub metadata_valid (%info) { | |
| 97 | 97 | return metadata_spec_known(%info) | |
| … | … | ||
| 158 | 158 | return 1; | |
| 159 | 159 | } | |
| 160 | 160 | ||
| 161 | =begin | ||
| 161 | 162 | ||
| 162 | 163 | =back | |
| 163 | 164 | ||
| 164 | =cut | ||
| 165 | =end |
|   | |||
| 1 | 1 | # Copyright (C) 2009, Parrot Foundation. | |
| 2 | 2 | # $Id$ | |
| 3 | 3 | ||
| 4 | =begin | ||
| 5 | |||
| 4 | 6 | =head1 NAME | |
| 5 | 7 | ||
| 6 | 8 | Plumage::Downloader - Fetch the contents of a url in various ways | |
| … | … | ||
| 15 | 15 | ||
| 16 | 16 | Downloads files. | |
| 17 | 17 | ||
| 18 | =cut | ||
| 18 | =end | ||
| 19 | 19 | ||
| 20 | 20 | .namespace ['Plumage';'Downloader'] | |
| 21 | 21 |
src/lib/Util.nqp
(18 / 8)
|   | |||
| 2 | 2 | ||
| 3 | 3 | Util.nqp - Utility functions for NQP and Plumage | |
| 4 | 4 | ||
| 5 | =begin | ||
| 5 | 6 | ||
| 6 | 7 | =head1 SYNOPSIS | |
| 7 | 8 | ||
| … | … | ||
| 26 | 26 | ||
| 27 | 27 | =head1 DESCRIPTION | |
| 28 | 28 | ||
| 29 | =cut | ||
| 29 | =end | ||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | # NQP bug XXXX: Fakecutables broken because 'nqp' language is not loaded. | |
| … | … | ||
| 47 | 47 | our %CONF; | |
| 48 | 48 | our $OS; | |
| 49 | 49 | ||
| 50 | =begin | ||
| 50 | 51 | ||
| 51 | 52 | =head2 Basic Functions | |
| 52 | 53 | ||
| … | … | ||
| 64 | 64 | application of C<&code> to an item in the C<@originals> produces exactly | |
| 65 | 65 | one entry in the C<@mapped> output. | |
| 66 | 66 | ||
| 67 | =cut | ||
| 67 | =end | ||
| 68 | 68 | ||
| 69 | 69 | sub map (&code, @originals) { | |
| 70 | 70 | my @mapped; | |
| … | … | ||
| 76 | 76 | return @mapped; | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | =begin | ||
| 79 | 80 | ||
| 80 | 81 | =head2 General Utilities | |
| 81 | 82 | ||
| … | … | ||
| 92 | 92 | setting their corresponding value to 1, thus allowing cheap set membership | |
| 93 | 93 | checks. | |
| 94 | 94 | ||
| 95 | =cut | ||
| 95 | =end | ||
| 96 | 96 | ||
| 97 | 97 | sub set_from_array (@array) { | |
| 98 | 98 | my %set; | |
| … | … | ||
| 105 | 105 | } | |
| 106 | 106 | ||
| 107 | 107 | ||
| 108 | =begin | ||
| 109 | |||
| 108 | 110 | =back | |
| 109 | 111 | ||
| 110 | 112 | ||
| … | … | ||
| 132 | 132 | # Not found, try a different $program or fail | |
| 133 | 133 | } | |
| 134 | 134 | ||
| 135 | =cut | ||
| 135 | =end | ||
| 136 | 136 | ||
| 137 | 137 | sub find_program ($program) { | |
| 138 | 138 | my $path_sep := $OS eq 'MSWin32' ?? ';' !! ':'; | |
| … | … | ||
| 155 | 155 | return ''; | |
| 156 | 156 | } | |
| 157 | 157 | ||
| 158 | =begin | ||
| 158 | 159 | ||
| 159 | 160 | =item mkpath($directory_path) | |
| 160 | 161 | ||
| 161 | 162 | Basically an iterative C<mkdir()>, C<mkpath()> works its way down from the | |
| 162 | 163 | top making directories as needed until an entire path has been created. | |
| 163 | 164 | ||
| 164 | =cut | ||
| 165 | =end | ||
| 165 | 166 | ||
| 166 | 167 | sub mkpath ($path) { | |
| 167 | 168 | my @path := split('/', $path); | |
| … | … | ||
| 177 | 177 | } | |
| 178 | 178 | } | |
| 179 | 179 | ||
| 180 | =begin | ||
| 180 | 181 | ||
| 181 | 182 | =item $writable := test_dir_writable($directory_path) | |
| 182 | 183 | ||
| … | … | ||
| 192 | 192 | checking for errors on every real operation can avoid security holes due to | |
| 193 | 193 | race conditions between test and action. | |
| 194 | 194 | ||
| 195 | =cut | ||
| 195 | =end | ||
| 196 | 196 | ||
| 197 | 197 | sub test_dir_writable($dir) { | |
| 198 | 198 | my $test_file := fscat(as_array($dir), 'WrItAbLe.UtL'); | |
| … | … | ||
| 214 | 214 | } | |
| 215 | 215 | ||
| 216 | 216 | ||
| 217 | =begin | ||
| 218 | |||
| 217 | 219 | =head2 Plumage Specific Functions | |
| 218 | 220 | ||
| 219 | 221 | While the previous functions are likely usable by a great variety of NQP | |
| … | … | ||
| 248 | 248 | caused by bad config settings, nor is it protected from nefarious inputs | |
| 249 | 249 | producing unintended expansions. | |
| 250 | 250 | ||
| 251 | =cut | ||
| 251 | =end | ||
| 252 | 252 | ||
| 253 | 253 | sub replace_config_strings ($original) { | |
| 254 | 254 | my $new := $original; | |
| … | … | ||
| 273 | 273 | return $config; | |
| 274 | 274 | } | |
| 275 | 275 | ||
| 276 | =begin | ||
| 276 | 277 | ||
| 277 | 278 | =back | |
| 278 | 279 | ||
| 279 | =cut | ||
| 280 | =end |

