summaryrefslogtreecommitdiffstats
path: root/etc/inc/pkg-utils.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2011-01-06 17:48:33 -0500
committerScott Ullrich <sullrich@pfsense.org>2011-01-06 17:48:33 -0500
commit86af45ecbed9fc0dddfd840c6384e015fe8a597f (patch)
tree7d4fecdf2cb47711c60ece20c241cde7db8e49a4 /etc/inc/pkg-utils.inc
parent64974db724dd0e6eeb4de63c63b56450a43903be (diff)
downloadpfsense-86af45ecbed9fc0dddfd840c6384e015fe8a597f.zip
pfsense-86af45ecbed9fc0dddfd840c6384e015fe8a597f.tar.gz
Ensure $pkg is defined. Send pkg_delete errors to /tmp/pkg-delete_errors.txt
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r--etc/inc/pkg-utils.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index f2ee955..ea8c7d7 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -98,7 +98,7 @@ conf_mount_ro();
*
******/
function remove_freebsd_package($packagestring) {
- exec("/usr/sbin/pkg_delete -x {$packagestring}");
+ exec("/usr/sbin/pkg_delete -x {$packagestring} 2>>/tmp/pkg_delete_errors.txt");
}
/****f* pkg-utils/is_package_installed
@@ -222,6 +222,8 @@ function resync_all_package_configs($show_message = false) {
* package is installed.
*/
function is_freebsd_pkg_installed($pkg) {
+ if(!$pkg)
+ return;
$output = "";
exec("/usr/sbin/pkg_info -E \"{$pkg}*\"", $output, $retval);
@@ -826,6 +828,9 @@ function does_package_depend($pkg) {
function delete_package($pkg) {
global $config, $g, $static_output, $vardb;
+ if(!$pkg)
+ return;
+
$pkg = substr(reverse_strrchr($pkg, "."), 0, -1);
// If package has dependencies then skip it
OpenPOWER on IntegriCloud