summaryrefslogtreecommitdiff
path: root/test/test.d/db-move.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-18 12:07:09 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-04-16 13:49:57 -0400
commit7850874b1ef1b18de585be108e3be899d95a3a2a (patch)
tree173896aa05b68545672124dbe28b098fec98ee0a /test/test.d/db-move.sh
parent282bf65c81e278b9237b4c202d325642bc0aa1a3 (diff)
Fix quoting around variables, especially arrays.
Other than pure quoting, this involved: - swapping */@ for array access in a few places - fiddling with printf in a pipeline - replacing `$(echo ${array[@]})` with `${array[*]}` - replacing `echo $(...)` with `...` When searching for these things, I used the command: grep -Prn --exclude-dir=.git '(?<!["=]|\[\[ |\[\[ -[zn] )\$(?!{?#|\(|\? )' and ignored a bunch of false positives.
Diffstat (limited to 'test/test.d/db-move.sh')
-rwxr-xr-xtest/test.d/db-move.sh64
1 files changed, 32 insertions, 32 deletions
diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh
index 890ffc4..e3207b6 100755
--- a/test/test.d/db-move.sh
+++ b/test/test.d/db-move.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testMoveSimplePackages() {
@@ -9,9 +9,9 @@ testMoveSimplePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage testing ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage testing "${pkgbase}" "${arch}"
done
done
@@ -19,11 +19,11 @@ testMoveSimplePackages() {
../db-move testing extra pkg-simple-a
- for arch in ${arches[@]}; do
- checkPackage extra pkg-simple-a-1-1-${arch}.pkg.tar.xz ${arch}
- checkRemovedPackage testing pkg-simple-a-1-1-${arch}.pkg.tar.xz ${arch}
+ for arch in "${arches[@]}"; do
+ checkPackage extra "pkg-simple-a-1-1-${arch}.pkg.tar.xz" "${arch}"
+ checkRemovedPackage testing "pkg-simple-a-1-1-${arch}.pkg.tar.xz" "${arch}"
- checkPackage testing pkg-simple-b-1-1-${arch}.pkg.tar.xz ${arch}
+ checkPackage testing "pkg-simple-b-1-1-${arch}.pkg.tar.xz" "${arch}"
done
}
@@ -33,9 +33,9 @@ testMoveMultiplePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage testing ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage testing "${pkgbase}" "${arch}"
done
done
@@ -43,10 +43,10 @@ testMoveMultiplePackages() {
../db-move testing extra pkg-simple-a pkg-simple-b
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkPackage extra ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
- checkRemovedPackage testing ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ checkPackage extra "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}"
+ checkRemovedPackage testing "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}"
done
done
}
@@ -57,9 +57,9 @@ testMoveEpochPackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage testing ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage testing "${pkgbase}" "${arch}"
done
done
@@ -67,9 +67,9 @@ testMoveEpochPackages() {
../db-move testing extra pkg-simple-epoch
- for arch in ${arches[@]}; do
- checkPackage extra pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch}
- checkRemovedPackage testing pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch}
+ for arch in "${arches[@]}"; do
+ checkPackage extra "pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz" "${arch}"
+ checkRemovedPackage testing "pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz" "${arch}"
done
}
@@ -77,8 +77,8 @@ testMoveAnyPackages() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
- for pkgbase in ${pkgs[@]}; do
- releasePackage testing ${pkgbase} any
+ for pkgbase in "${pkgs[@]}"; do
+ releasePackage testing "${pkgbase}" any
done
../db-update
@@ -96,23 +96,23 @@ testMoveSplitPackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage testing ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage testing "${pkgbase}" "${arch}"
done
done
../db-update
../db-move testing extra pkg-split-a
- for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/pkg-split-a"/*-${arch}${PKGEXT}; do
- checkPackage extra ${pkg##*/} ${arch}
+ for arch in "${arches[@]}"; do
+ for pkg in "${pkgdir}/pkg-split-a"/*-"${arch}"${PKGEXT}; do
+ checkPackage extra "${pkg##*/}" "${arch}"
done
done
- for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/pkg-split-b"/*-${arch}${PKGEXT}; do
- checkPackage testing ${pkg##*/} ${arch}
+ for arch in "${arches[@]}"; do
+ for pkg in "${pkgdir}/pkg-split-b"/*-"${arch}"${PKGEXT}; do
+ checkPackage testing "${pkg##*/}" "${arch}"
done
done