From 8af4dd4ca78a25fafb0e28519a9ba3b52b55aab2 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 7 May 2015 15:07:02 -0300 Subject: Fix delete_package for pkg --- etc/inc/pkg-utils.inc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'etc/inc/pkg-utils.inc') 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; } -- cgit v1.1