summaryrefslogtreecommitdiff
path: root/src/librefetch/librefetch
diff options
context:
space:
mode:
Diffstat (limited to 'src/librefetch/librefetch')
-rwxr-xr-xsrc/librefetch/librefetch26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch
index c1ff548..9b04837 100755
--- a/src/librefetch/librefetch
+++ b/src/librefetch/librefetch
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# librefetch
#
-# Copyright (C) 2013-2018 Luke Shumaker <lukeshu@parabola.nu>
+# Copyright (C) 2013-2018, 2024 Luke Shumaker <lukeshu@parabola.nu>
+# Copyright (C) 2020 Bill Auger <mr.j.spam.me@gmail.com>
#
# For just the create_signature() function:
# Copyright (C) 2006-2013 Pacman Development Team <pacman-dev@archlinux.org>
@@ -221,6 +222,7 @@ doit() {
mv -f "$base_dst" "$dst"
fi
else
+ export PKGEXT=${base_dst##*/} # so the file uses the correct compression
export PKGDEST=${dst%/*}
export pkg_file=$dst
@@ -321,23 +323,23 @@ modified_makepkg() {
# a string to be appended
pkgbuild_append='
+declare _librefetch_i
+
# do not do split packages
-if [[ ${#pkgname[@]} -gt 1 ]]; then
- if [[ -n $pkgbase ]]; then
- pkgname=("$pkgbase")
- else
- pkgname=("$pkgname")
- fi
-fi
+declare _librefetch_pkgname="${pkgbase:-$pkgname}"
+for _librefetch_i in "${pkgname[@]}"; do
+ unset -f "package_${_librefetch_i}"
+done
+unset pkgname
+pkgname=$_librefetch_pkgname
# copy source variables
source=("${mksource[@]}") ; unset "source_${CARCH}"
noextract=("${mknoextract[@]}")
-declare algo
-for algo in "${known_hash_algos[@]}"; do
- eval "${algo}sums=(\"\${mk${algo}sums[@]}\")"
- unset "${algo}sums_${CARCH}"
+for _librefetch_i in "${known_hash_algos[@]}"; do
+ eval "${_librefetch_i}sums=(\"\${mk${_librefetch_i}sums[@]}\")"
+ unset "${_librefetch_i}sums_${CARCH}"
done
depends=() ; unset "depends_${CARCH}"