summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-04-04 13:40:12 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-04-06 13:51:50 -0400
commitb2163413b980b8359adf3f4beec1bb69e4ba6d71 (patch)
treed31302ab41a1da4eda5e69a39d09215c10a66cc2
parent0c3b06c84e65ffcb8aab669269402a8dc47704e4 (diff)
test: common.bash: checkPackageDB(): Require the DB file to exist
In 3a9623ba96dc8a26120be89354115dc120e71374 when I adjusted the function to work correctly with `set -e`, I misread the interaction between parenthesis and ||. I had treated it like the more common ([ test ] && bsdtar) && fail -> if [ test ]; then ! bsdtar; fi pattern, and incorrectly adjusted it as ([ test ] && bsdtar) || fail -> if [ test ]; then bsdtar; fi but I should have translated it as ([ test ] && bsdtar) || fail -> [ test ] && bsdtar The result is that we weren't requiring the DB file to exist. Note that Pierre got it right in Arch's version of the change, d0b808b5a58023899c7e76958cdae732bbdfc08e.
-rw-r--r--test/lib/common.bash5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/lib/common.bash b/test/lib/common.bash
index aeed8a0..73248d7 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -171,9 +171,8 @@ checkAnyPackageDB() {
[ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig")" == "$(readlink -e "${FTP_BASE}/${PKGPOOL}/${pkg}.sig")" ]
for db in "${DBEXT}" "${FILESEXT}"; do
- if [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ]; then
- bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep "${pkg}" &>/dev/null
- fi
+ [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ]
+ bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep "${pkg}" &>/dev/null
done
done
[ ! -r "${STAGING}/${repo}/${pkg}" ]