summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-07-15 21:54:26 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-08-20 19:54:30 -0400
commit6a7f4d2cadf02200802e4c36e6a1cb9ee75e7484 (patch)
tree447618e9bfee2ed6f706ba026673fefc83d8448d
parentfa9b37edc298bdba896d4c44eecf02bfb54d84f8 (diff)
db-remove: Don't assume that the list of pkgnames is the same for every tarch
Consider glibc, for which pkgname=(glibc lib32-glibc). It wouldn't include lib32-glibc on any architecture other than x86_64.
-rwxr-xr-xdb-remove13
1 files changed, 7 insertions, 6 deletions
diff --git a/db-remove b/db-remove
index 65d7e85..4748884 100755
--- a/db-remove
+++ b/db-remove
@@ -24,19 +24,20 @@ fi
for tarch in "${tarches[@]}"; do
repo_lock "$repo" "$tarch" || exit 1
+ declare -a remove_pkgs_$tarch
done
-
-remove_pkgs=()
for pkgbase in "${pkgbases[@]}"; do
msg "Removing %s from [%s]..." "$pkgbase" "$repo"
-
- mapfile -t pkgnames < <(arch_expac_pkgbase "$repo" "${tarches[0]}" '%n' "$pkgbase")
- remove_pkgs+=("${pkgnames[@]}")
-
+ for tarch in "${tarches[@]}"; do
+ declare -n remove_pkgs="remove_pkgs_${tarch}"
+ mapfile -t pkgnames < <(arch_expac_pkgbase "$repo" "$tarch" '%n' "$pkgbase")
+ remove_pkgs+=("${pkgnames[@]}")
+ done
vcs_remove "$repo" "$arch" "$pkgbase"
done
for tarch in "${tarches[@]}"; do
+ declare -n remove_pkgs="remove_pkgs_${tarch}"
arch_repo_modify remove "${repo}" "${tarch}" "${remove_pkgs[@]}"
repo_unlock "$repo" "$tarch"
done