summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-12-27 01:48:42 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-12-27 01:48:42 +0000
commitbd997551c058eedf3e17b76337f2c85f66914861 (patch)
tree1c9a8f3153aedfbdb12703d2c36267b31aa87482 /etc
parentf6f3b7e0a60c61a41807011a040b86c12f03811d (diff)
downloadpfsense-bd997551c058eedf3e17b76337f2c85f66914861.zip
pfsense-bd997551c058eedf3e17b76337f2c85f66914861.tar.gz
Correctly remove freebsd package upon package deletion.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pkg-utils.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 639fd9f..e414c72 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -56,7 +56,9 @@ if($g['platform'] == "pfSense") {
*
******/
function remove_freebsd_package($packagestring) {
+
exec("cd /var/db/pkg && pkg_delete `ls | grep $packagestring`");
+ log_error("cd /var/db/pkg && pkg_delete ls | grep $packagestring");
}
/****f* pkg-utils/is_package_installed
@@ -183,6 +185,7 @@ function get_pkg_depends($pkg_name, $filetype = ".xml", $format = "files", $retu
log_error("The {$package['name']} package is missing required dependencies and must be reinstalled. " . $package['configurationfile']);
install_package($package['name']);
uninstall_package_from_name($package['name']);
+ remove_freebsd_package($package['name']);
install_package($package['name']);
return;
}
@@ -236,11 +239,13 @@ function uninstall_package_from_name($pkg_name) {
$todel = substr(reverse_strrchr($config['installedpackages']['package'][$id]['depends_on_package'], "."), 0, -1);
delete_package($todel, $pkg_name);
delete_package_xml($pkg_name);
+ remove_freebsd_package($pkg_name);
}
function force_remove_package($pkg_name) {
global $config;
delete_package_xml($pkg_name);
+ remove_freebsd_package($pkg_name);
}
/*
@@ -728,9 +733,10 @@ function delete_package($pkg, $pkgid) {
require_once($pkg_config['include_file']);
}
}
- $static_output .= "\Starting package deletion...\n";
+ $static_output .= "\nStarting package deletion for {$pkg_info['name']}...\n";
update_output_window($static_output);
delete_package_recursive($pkg);
+ remove_freebsd_package($pkg_info['name']);
$static_output .= "done.\n";
update_output_window($static_output);
return;
@@ -740,6 +746,7 @@ function delete_package_recursive($pkg) {
$info = "";
exec("/usr/sbin/pkg_info -r " . $pkg . " 2>&1", $info);
exec("cat {$g['tmp_path']}/y | /usr/sbin/pkg_delete " . $pkg ." > /dev/null 2>&1");
+ remove_freebsd_package($pkg);
$pkgdb = "";
exec("/bin/ls /var/db/pkg", $pkgdb);
if(stristr($info[0], "can't find package") != false) return;
@@ -965,4 +972,5 @@ function squash_from_bytes($size, $round = "") {
}
return;
}
-?>
+
+?> \ No newline at end of file
OpenPOWER on IntegriCloud