summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2019-12-04 12:39:34 +0100
committerLevente Polyak <anthraxx@archlinux.org>2019-12-08 20:59:11 +0100
commitd6866e0544581840cc021e4be68c1c450fcb7963 (patch)
tree37af4a116a58be53ce08f850e5a2fbe8c90fc8f9
parent8edad226166eb6f2888b87cf8e0a9952822c887a (diff)
downloaddevtools32-d6866e0544581840cc021e4be68c1c450fcb7963.tar.xz
lib: support arbitrary compressed package files
We need to modify the matching of valid package files to support formats like zstd. Let's try to use an eager approach instead of a simple whitelist in order to be functional for arbitrary formats that may be introduced in the future without the need to adjust any code. Allow any single fragment word as compression type but filter out known non-package content like signature files. Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
-rw-r--r--lib/common.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/common.sh b/lib/common.sh
index eaa16a4..fce52f6 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -142,7 +142,7 @@ find_cached_package() {
for dir in "${searchdirs[@]}"; do
[[ -d $dir ]] || continue
- for pkg in "$dir"/*.pkg.tar?(.?z); do
+ for pkg in "$dir"/*.pkg.tar?(.!(sig|*.*)); do
[[ -f $pkg ]] || continue
# avoid adding duplicates of the same inode
@@ -152,7 +152,7 @@ find_cached_package() {
# split apart package filename into parts
pkgbasename=${pkg##*/}
- pkgbasename=${pkgbasename%.pkg.tar?(.?z)}
+ pkgbasename=${pkgbasename%.pkg.tar*}
arch=${pkgbasename##*-}
pkgbasename=${pkgbasename%-"$arch"}