From e34eaa423d768930630bc9fc34f7534ac95be9ff Mon Sep 17 00:00:00 2001 From: Shaun Zinck Date: Thu, 24 Jan 2013 19:58:31 -0600 Subject: [PATCH] pkgin: change install/remove to not use return code of pkgin pkgin always returns 0 so can't be used to tell if the install or remove worked. Instead this just queries the installed packages after performing an operation. --- library/pkgin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/pkgin b/library/pkgin index 0d67341b2ee..acbc55e0461 100755 --- a/library/pkgin +++ b/library/pkgin @@ -82,7 +82,7 @@ def remove_packages(module, packages): rc = os.system("%s -y remove %s" % (PKGIN_PATH, package)) - if rc != 0: + if query_package(module, package): module.fail_json(msg="failed to remove %s" % (package)) remove_c += 1 @@ -104,7 +104,7 @@ def install_packages(module, packages): rc = os.system("%s -y install %s" % (PKGIN_PATH, package)) - if rc != 0: + if not query_package(module, package): module.fail_json(msg="failed to install %s" % (package)) install_c += 1