summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/general/plugins/modules/pkgin.py
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/community/general/plugins/modules/pkgin.py')
-rw-r--r--ansible_collections/community/general/plugins/modules/pkgin.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/ansible_collections/community/general/plugins/modules/pkgin.py b/ansible_collections/community/general/plugins/modules/pkgin.py
index c08b25218..5b2e478b8 100644
--- a/ansible_collections/community/general/plugins/modules/pkgin.py
+++ b/ansible_collections/community/general/plugins/modules/pkgin.py
@@ -30,7 +30,7 @@ author:
notes:
- "Known bug with pkgin < 0.8.0: if a package is removed and another
package depends on it, the other package will be silently removed as
- well. New to Ansible 1.9: check-mode support."
+ well."
extends_documentation_fragment:
- community.general.attributes
attributes:
@@ -174,6 +174,13 @@ def query_package(module, name):
# '<' - installed but out of date
# '=' - installed and up to date
# '>' - installed but newer than the repository version
+
+ if (package in ('reading local summary...',
+ 'processing local summary...',
+ 'downloading pkg_summary.xz done.')) or \
+ (package.startswith('processing remote summary (')):
+ continue
+
pkgname_with_version, raw_state = package.split(splitchar)[0:2]
# Search for package, stripping version
@@ -317,7 +324,7 @@ def do_upgrade_packages(module, full=False):
format_pkgin_command(module, cmd))
if rc == 0:
- if re.search('^nothing to do.\n$', out):
+ if re.search('^(.*\n|)nothing to do.\n$', out):
module.exit_json(changed=False, msg="nothing left to upgrade")
else:
module.fail_json(msg="could not %s packages" % cmd, stdout=out, stderr=err)