diff options
author | Vinicius Coque <vinicius.coque@bluepex.com> | 2011-09-28 20:09:51 -0300 |
---|---|---|
committer | Vinicius Coque <vinicius.coque@bluepex.com> | 2011-09-29 00:49:29 -0300 |
commit | 43dad535685e0247192744e2bc7856005f1856dc (patch) | |
tree | 0b9582bcb449749da9a7b8bef31234580ab116b5 /etc/inc/pkg-utils.inc | |
parent | 9a4cfa0b23d27db263420cdcf54edfa86c034ad3 (diff) | |
download | pfsense-43dad535685e0247192744e2bc7856005f1856dc.zip pfsense-43dad535685e0247192744e2bc7856005f1856dc.tar.gz |
Create symlinks for bin and sbin directories on /usr/local/ after installing a PBI
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 2a8604c..f59fddc 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -452,7 +452,7 @@ function sync_package($pkg_name, $sync_depends = true, $show_message = false) { } /* - * pkg_fetch_recursive: Download and install a FreeBSD package and its dependencies. This function provides output to + * pkg_fetch_recursive: Download and install a FreeBSD PBI package. This function provides output to * a progress bar and output window. */ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = "") { @@ -499,9 +499,22 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = update_output_window($static_output); $pkgaddout = ""; - exec("{$pkgtmpdir}/usr/local/sbin/pbi_add {$pkgstaging} -fv {$fetchto} 2>&1", $pkgaddout); + + exec("/usr/local/sbin/pbi_add {$pkgstaging} -f -v --no-checksig {$fetchto} 2>&1", $pkgaddout); pkg_debug($pkgname . " " . print_r($pkgaddout, true) . "\npbi_add successfully completed.\n"); + exec("/usr/local/bin/pbi_info " . preg_replace('/\.pbi$/','',$filename) . " | /usr/bin/awk '/Prefix/ {print $2}'",$pbidir); + $pbidir = $pbidir[0]; + $linkdirs = array('bin','sbin'); + foreach($linkdirs as $dir) { + if(is_dir("{$pbidir}/{$dir}")) { + $files = scandir("{$pbidir}/{$dir}"); + foreach($files as $f) { + symlink("{$pbidir}/{$dir}/${$f}","/usr/local/{$dir}/{$f}"); + } + } + } + return true; } |