summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-07-15 21:37:52 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-08-20 19:54:30 -0400
commitfa9b37edc298bdba896d4c44eecf02bfb54d84f8 (patch)
treef2f6e7194ba14cddc84944e05b5b09c7b17fc3aa
parent656cd4bbb6f991775cd3bcdc0fc9843ee86c9775 (diff)
test: db-remove: Verify that it handles pkgnames list differing between arches [ci-skip]
-rwxr-xr-xdb-move4
-rwxr-xr-xtest/cases/db-remove.bats20
-rw-r--r--test/fixtures/pkg-split-multilib/PKGBUILD19
3 files changed, 41 insertions, 2 deletions
diff --git a/db-move b/db-move
index 6a04a84..06d1345 100755
--- a/db-move
+++ b/db-move
@@ -54,10 +54,10 @@ for pkgbase in "${args[@]:2}"; do
vcs_move_start "$repo_from" "$repo_to" "$pkgbase"
for tarch in "${ARCHES[@]}"; do
msg2 "%s (%s)" "$pkgbase" "$tarch"
+ declare -n add_pkgs="add_pkgs_${tarch}"
+ declare -n remove_pkgs="remove_pkgs_${tarch}"
vcs_move_arch "$tarch"
while read -r pkgname pkgver pkgfile; do
- declare -n add_pkgs="add_pkgs_${tarch}"
- declare -n remove_pkgs="remove_pkgs_${tarch}"
ln -s "../../../${PKGPOOL}/${pkgfile}" "${ftppath_to}/${tarch}/"
if [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig ]]; then
diff --git a/test/cases/db-remove.bats b/test/cases/db-remove.bats
index ffbe008..06a5f2f 100755
--- a/test/cases/db-remove.bats
+++ b/test/cases/db-remove.bats
@@ -59,6 +59,26 @@ load ../lib/common
bsdtar xfO "$FTP_BASE/extra/os/x86_64/extra.db" pkg-split-a2-1-1/desc >/dev/null
}
+@test "remove split multilib package" {
+ # NB: it's important for the accuracy of this test that i686
+ # is before x86_64 in config:ARCHES
+ local arches=('i686' 'x86_64')
+ local arch
+
+ releasePackage extra pkg-split-multilib
+ db-update
+
+ bsdtar xfO "$FTP_BASE/extra/os/x86_64/extra.db" lib32-pkg-split-multilib-1-1/desc >/dev/null
+
+ for arch in ${arches[@]}; do
+ db-remove extra any pkg-split-multilib
+ done
+
+ if bsdtar xfO "$FTP_BASE/extra/os/i686/extra.db" pkg-split-multilib-1-1/desc >/dev/null; then return 1; fi
+ if bsdtar xfO "$FTP_BASE/extra/os/x86_64/extra.db" pkg-split-multilib-1-1/desc >/dev/null; then return 1; fi
+ if bsdtar xfO "$FTP_BASE/extra/os/x86_64/extra.db" lib32-pkg-split-multilib-1-1/desc >/dev/null; then return 1; fi
+}
+
@test "remove any packages" {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
diff --git a/test/fixtures/pkg-split-multilib/PKGBUILD b/test/fixtures/pkg-split-multilib/PKGBUILD
new file mode 100644
index 0000000..ac57502
--- /dev/null
+++ b/test/fixtures/pkg-split-multilib/PKGBUILD
@@ -0,0 +1,19 @@
+pkgbase=pkg-split-multilib
+pkgname=("$pkgbase")
+[[ $CARCH != x86_64 ]] || pkgname+=("lib32-$pkgbase")
+pkgver=1
+pkgrel=1
+pkgdesc="A split package called ${pkgbase}"
+arch=('i686' 'x86_64')
+url='http://www.archlinux.org/'
+license=('GPL')
+depends=('glibc')
+options=(!strip)
+
+package_pkg-split-multilib() {
+ install -D -m755 /bin/true "${pkgdir}"/usr/bin/${pkgname}
+}
+
+package_lib32-pkg-split-multilib() {
+ install -D -m755 /bin/true "${pkgdir}"/usr/bin/${pkgname}
+}