From 0d579b5985accc4cee674f2d079e6e0a73772cf7 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 1 Jul 2015 10:18:28 -0300 Subject: Only try to remove pkg if it's installed, otherwise just cleanup xml part --- etc/inc/pkg-utils.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'etc/inc/pkg-utils.inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index b6ec8d0..e37c286 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -381,15 +381,20 @@ function resync_all_package_configs($show_message = false) { function uninstall_package($package_name) { global $config, $static_output; + $internal_name = $package_name; $id = get_package_id($package_name); if ($id >= 0) { $internal_name = get_package_internal_name($config['installedpackages']['package'][$id]); stop_service($internal_name); + } + + if (is_pkg_installed($internal_name)) { $static_output .= "Removing package...\n"; update_output_window($static_output); pkg_delete($internal_name); + } else { + delete_package_xml($package_name); } - delete_package_xml($package_name); $static_output .= gettext("done.") . "\n"; update_output_window($static_output); -- cgit v1.1