diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-01-31 11:54:44 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-02-04 12:34:41 -0200 |
commit | 4c9bda43f5bcfd5ba9812c84199bbe4f1f158960 (patch) | |
tree | a2d3365ed58a99c42f3715aa1f993d8c1b1f8202 /etc/inc/pkg-utils.inc | |
parent | ca79de534b45c064d760dc8d04317b57b3ca730a (diff) | |
download | pfsense-4c9bda43f5bcfd5ba9812c84199bbe4f1f158960.zip pfsense-4c9bda43f5bcfd5ba9812c84199bbe4f1f158960.tar.gz |
Set PATH before call pbi related binaries
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 178ff7c..41e7286 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -102,6 +102,7 @@ function remove_freebsd_package($packagestring) { // The packagestring passed in must be the full PBI package name, // as displayed by the pbi_info utility. e.g. "package-1.2.3_4-i386" // It must NOT have ".pbi" on the end. + putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"); exec("/usr/local/sbin/pbi_info {$packagestring} | /usr/bin/awk '/Prefix/ {print $2}'",$pbidir); $pbidir = $pbidir[0]; if ($pbidir == "") { @@ -277,6 +278,7 @@ function is_freebsd_pkg_installed($pkg) { if(!$pkg) return; $output = ""; + putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"); exec("/usr/local/sbin/pbi_info \"{$pkg}\"", $output, $retval); return (intval($retval) == 0); @@ -563,6 +565,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = $pkgaddout = ""; + putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"); 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"); setup_library_paths(); @@ -855,6 +858,7 @@ function install_package_xml($pkg) { // e.g. "squidguard-1.4_4-i386" so feed lowercase to pbi_info below. // Also add the "-" so that examples like "squid-" do not match "squidguard-". $pkg_name_for_pbi_match = strtolower($pkg) . "-"; + putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"); exec("/usr/local/sbin/pbi_info | grep '^{$pkg_name_for_pbi_match}' | xargs /usr/local/sbin/pbi_info | awk '/Prefix/ {print $2}'",$pbidirarray); $pbidir0 = $pbidirarray[0]; exec("find /usr/local/etc/ -name *.conf | grep \"{$pkg}\"",$files); |