summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-02-19 11:12:02 -0500
committerLuke Shumaker <lukeshu@parabola.nu>2018-04-06 17:22:16 -0400
commite91c2cc010cb3988b311d2b3dd36833b6ab1f5d4 (patch)
tree0eda2da9438da439e5794031bb66376edb91a40b
parent7f1402bc63a633bc8ea410ff41d324c257c53168 (diff)
Fix overloading PKGEXT to mean two things.lukeshu/2018-merge/cherry-pick+pkgexts
PKGEXT is a makepkg variable referring to a fixed filename suffix, but we were also using it to mean a bash glob referring to candidate filenames. This is wrong, so rename it to PKGEXTS which is more descriptive of its purpose. Exclude the testsuite from this change, as the testsuite actually uses PKGEXT for its intended purpose. Fix the testsuite to consistently use PKGEXT, as it hardcoded the file extension in several cases, and pin its value to .pkg.tar.xz (cherry picked from commit 07e6a91da1331ae61b667d878092c5b03aa49ced)
-rw-r--r--test/cases/db-repo-add.bats6
-rw-r--r--test/cases/db-update.bats3
-rw-r--r--test/cases/ftpdir-cleanup.bats6
-rw-r--r--test/lib/common.bash4
4 files changed, 9 insertions, 10 deletions
diff --git a/test/cases/db-repo-add.bats b/test/cases/db-repo-add.bats
index 9fde381..ac91058 100644
--- a/test/cases/db-repo-add.bats
+++ b/test/cases/db-repo-add.bats
@@ -31,7 +31,7 @@ __movePackageToRepo() {
releasePackage extra ${pkgbase}
for arch in ${arches[@]}; do
__movePackageToRepo extra ${pkgbase} ${arch}
- db-repo-add extra ${arch} ${pkgbase}-1-1-${arch}.pkg.tar.xz
+ db-repo-add extra ${arch} ${pkgbase}-1-1-${arch}${PKGEXT}
done
done
@@ -54,7 +54,7 @@ __movePackageToRepo() {
add_pkgs=()
for pkgbase in ${pkgs[@]}; do
__movePackageToRepo extra ${pkgbase} ${arch}
- add_pkgs+=("${pkgbase}-1-1-${arch}.pkg.tar.xz")
+ add_pkgs+=("${pkgbase}-1-1-${arch}${PKGEXT}")
done
db-repo-add extra ${arch} ${add_pkgs[@]}
done
@@ -73,7 +73,7 @@ __movePackageToRepo() {
for pkgbase in ${pkgs[@]}; do
releasePackage extra ${pkgbase}
__movePackageToRepo extra ${pkgbase} any
- db-repo-add extra any ${pkgbase}-1-1-any.pkg.tar.xz
+ db-repo-add extra any ${pkgbase}-1-1-any${PKGEXT}
done
for pkgbase in ${pkgs[@]}; do
diff --git a/test/cases/db-update.bats b/test/cases/db-update.bats
index 1da7eef..349b195 100644
--- a/test/cases/db-update.bats
+++ b/test/cases/db-update.bats
@@ -151,8 +151,7 @@ load ../lib/common
local p
releasePackage extra 'pkg-any-a'
for p in "${STAGING}"/extra/*${PKGEXT}; do
- unxz $p
- xz -0 ${p%%.xz}
+ printf '%s\n' "Not a real package" | gpg -v --detach-sign --no-armor --use-agent - > "${p}.sig"
done
run db-update
[ "$status" -ne 0 ]
diff --git a/test/cases/ftpdir-cleanup.bats b/test/cases/ftpdir-cleanup.bats
index 6280ce0..fd485f3 100644
--- a/test/cases/ftpdir-cleanup.bats
+++ b/test/cases/ftpdir-cleanup.bats
@@ -82,7 +82,7 @@ __checkRepoRemovedPackage() {
db-remove extra any pkg-any-a
ftpdir-cleanup
- local pkg1='pkg-any-a-1-1-any.pkg.tar.xz'
+ local pkg1="pkg-any-a-1-1-any${PKGEXT}"
checkRemovedPackage extra 'pkg-any-a'
for arch in ${arches[@]}; do
__checkRepoRemovedPackage extra 'pkg-any-a' ${arch}
@@ -138,8 +138,8 @@ __checkRepoRemovedPackage() {
ftpdir-cleanup
- local pkgfilea="pkg-simple-a-1-1-${arch}.pkg.tar.xz"
- local pkgfileb="pkg-simple-b-1-1-${arch}.pkg.tar.xz"
+ local pkgfilea="pkg-simple-a-1-1-${arch}${PKGEXT}"
+ local pkgfileb="pkg-simple-b-1-1-${arch}${PKGEXT}"
for arch in ${arches[@]}; do
touch -d "-$(expr ${CLEANUP_KEEP} + 1)days" ${CLEANUP_DESTDIR}/${pkgfilea}{,.sig}
done
diff --git a/test/lib/common.bash b/test/lib/common.bash
index 1d10440..24b2378 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -34,9 +34,9 @@ __buildPackage() {
pkgarches=($(. PKGBUILD; echo ${arch[@]}))
for tarch in ${pkgarches[@]}; do
if [ "${tarch}" == 'any' ]; then
- PKGDEST=${pkgdest} makepkg -c
+ PKGDEST=${pkgdest} PKGEXT=${PKGEXT} makepkg -c
else
- PKGDEST=${pkgdest} CARCH=${tarch} makepkg -c
+ PKGDEST=${pkgdest} PKGEXT=${PKGEXT} CARCH=${tarch} makepkg -c
fi
done