Révision 7860191a
Ajouté par Renato Botelho il y a presque 10 ans
etc/inc/pkg-utils.inc | ||
---|---|---|
524 | 524 |
$result = exec("/usr/local/sbin/pbi_add " . $pkgstaging . " -f -v {$no_checksig} " . escapeshellarg($fetchto) . " 2>&1", $pkgaddout, $rc); |
525 | 525 |
pkg_debug($pkgname . " " . print_r($pkgaddout, true) . "\n"); |
526 | 526 |
if ($rc == 0) { |
527 |
$links = get_pbi_binaries(escapeshellarg(preg_replace('/\.pbi$/','',$filename))); |
|
527 |
$pbi_name = preg_replace('/\.pbi$/','',$filename); |
|
528 |
|
|
529 |
$gb = exec("/usr/local/sbin/pbi_info {$pbi_name} | /usr/bin/awk '/Prefix/ {print $2}'", $pbi_prefix); |
|
530 |
$pbi_prefix = $pbi_prefix[0]; |
|
531 |
|
|
532 |
$links = get_pbi_binaries(escapeshellarg($pbi_name)); |
|
528 | 533 |
foreach($links as $link) { |
529 | 534 |
@unlink("/usr/local/{$link['link_name']}"); |
530 | 535 |
@symlink("{$link['target']}","/usr/local/{$link['link_name']}"); |
531 | 536 |
} |
537 |
|
|
538 |
$extra_links = array( |
|
539 |
array("target" => "bin", "link_name" => "sbin"), |
|
540 |
array("target" => "local/lib", "link_name" => "lib"), |
|
541 |
array("target" => "local/libexec", "link_name" => "libexec"), |
|
542 |
array("target" => "local/share", "link_name" => "share"), |
|
543 |
array("target" => "local/etc", "link_name" => "etc") |
|
544 |
); |
|
545 |
|
|
546 |
foreach ($extra_links as $link) { |
|
547 |
if (!file_exists($pbi_prefix . "/" . $link['target'])) |
|
548 |
continue; |
|
549 |
@rmdir("{$pbi_prefix}/{$link['link_name']}"); |
|
550 |
unlink_if_exists("{$pbi_prefix}/{$link['link_name']}"); |
|
551 |
@symlink("{$pbi_prefix}/{$link['target']}", "{$pbi_prefix}/{$link['link_name']}"); |
|
552 |
} |
|
532 | 553 |
pkg_debug("pbi_add successfully completed.\n"); |
533 | 554 |
} else { |
534 | 555 |
if (is_array($pkgaddout)) |
Formats disponibles : Unified diff
Create some symlinks inside pbi dir to reduce differences between 2.1 and 2.2 and avoid the need to change a lot of PBI scripts