diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-05-07 15:07:02 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-05-07 15:07:13 -0300 |
commit | 8af4dd4ca78a25fafb0e28519a9ba3b52b55aab2 (patch) | |
tree | 8ade7116a301521b5fc290023616a4a98c4af549 /etc/inc | |
parent | 801fcf24efa51d66fdb824286a87717a86d8404f (diff) | |
download | pfsense-8af4dd4ca78a25fafb0e28519a9ba3b52b55aab2.zip pfsense-8af4dd4ca78a25fafb0e28519a9ba3b52b55aab2.tar.gz |
Fix delete_package for pkg
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 8b50c4b..f1e0eaa 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -554,28 +554,20 @@ function install_package_xml($package_name) { return true; } -function delete_package($pkg) { - global $config, $g, $static_output, $vardb; +function delete_package($package_name) { + global $config, $g, $static_output; - if (!$pkg) { + if (!is_package_installed($package_name)) { return; } - // Note: $pkg has the full PBI package name followed by ".pbi". Strip off ".pbi". - $pkg = substr(reverse_strrchr($pkg, "."), 0, -1); - - if ($pkg) { - $static_output .= sprintf(gettext("Starting package deletion for %s..."),$pkg); - } + $static_output .= sprintf(gettext("Starting package deletion for %s..."),$package_name); update_output_window($static_output); - pkg_delete($pkg); + pkg_delete($package_name); $static_output .= "done.\n"; update_output_window($static_output); - /* Rescan directories for what has been left and avoid fooling other programs. */ - mwexec("/sbin/ldconfig"); - return; } |