From c58461596a995377e87bf65b97a5a51c9f902cbc Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 19 Dec 2016 23:08:45 +1100 Subject: [PATCH] Support pacman packages using different types of compression (#19503) It's possible to compress packages using several different compression methods, or not compressed at all. Previously, the pacman module only supported files compressed using xz. This update ensures that all compression types currently supported by pacman are supported by the ansible pacman module. The list of supported compression methods at the time of writing can be found here: https://git.archlinux.org/pacman.git/tree/scripts/makepkg.sh.in#n747 --- lib/ansible/modules/packaging/os/pacman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/pacman.py b/lib/ansible/modules/packaging/os/pacman.py index 9562cb21ec9..2cf8924dcae 100644 --- a/lib/ansible/modules/packaging/os/pacman.py +++ b/lib/ansible/modules/packaging/os/pacman.py @@ -348,7 +348,7 @@ def main(): pkg_files = [] for i, pkg in enumerate(pkgs): - if pkg.endswith('.pkg.tar.xz'): + if re.match(".*\.pkg\.tar(\.(gz|bz2|xz|lrz|lzo|Z))?$", pkg): # The package given is a filename, extract the raw pkg name from # it and store the filename pkg_files.append(pkg)