diff options
author | Luke T. Shumaker <lukeshu@parabola.nu> | 2024-02-21 09:31:19 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@parabola.nu> | 2024-02-21 10:18:52 -0700 |
commit | d7af69d13c9d9d64328de31055ca43ab63b25803 (patch) | |
tree | d4b16fc1be30938afb1bdcc711313675f521ed70 | |
parent | 7b9538d383841c7deb286dd0b8f31a5c40cb5d0f (diff) |
fix: librefetch: Handle split packages correctly
-rwxr-xr-x | src/librefetch/librefetch | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 1d7935b..8a62621 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -1,7 +1,7 @@ #!/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: @@ -322,23 +322,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}" |