summaryrefslogtreecommitdiff
path: root/test
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
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')
-rw-r--r--test/lib/common.inc116
-rw-r--r--test/packages/pkg-any-a/PKGBUILD4
-rw-r--r--test/packages/pkg-any-b/PKGBUILD4
-rw-r--r--test/packages/pkg-simple-a/PKGBUILD6
-rw-r--r--test/packages/pkg-simple-b/PKGBUILD6
-rw-r--r--test/packages/pkg-simple-epoch/PKGBUILD6
-rw-r--r--test/packages/pkg-split-a/PKGBUILD10
-rw-r--r--test/packages/pkg-split-b/PKGBUILD10
-rwxr-xr-xtest/runTest10
-rwxr-xr-xtest/test.d/create-filelists.sh44
-rwxr-xr-xtest/test.d/db-move.sh64
-rwxr-xr-xtest/test.d/db-remove.sh48
-rwxr-xr-xtest/test.d/db-repo-add.sh28
-rwxr-xr-xtest/test.d/db-repo-remove.sh36
-rwxr-xr-xtest/test.d/db-update.sh48
-rwxr-xr-xtest/test.d/ftpdir-cleanup.sh58
-rwxr-xr-xtest/test.d/packages.sh2
-rwxr-xr-xtest/test.d/signed-packages.sh8
-rwxr-xr-xtest/test.d/sourceballs.sh44
-rwxr-xr-xtest/test.d/testing2x.sh2
20 files changed, 277 insertions, 277 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc
index aeceece..bb3db5b 100644
--- a/test/lib/common.inc
+++ b/test/lib/common.inc
@@ -1,9 +1,9 @@
set -E
-. "$(dirname ${BASH_SOURCE[0]})/../../config"
+. "$(dirname "${BASH_SOURCE[0]}")/../../config"
# override the default TMPDIR
-TMPDIR="$(mktemp -d /tmp/${0##*/}.XXXXXXXXXX)"
-. "$(dirname ${BASH_SOURCE[0]})/../../db-functions"
+TMPDIR="$(mktemp -d "/tmp/${0##*/}.XXXXXXXXXX")"
+. "$(dirname "${BASH_SOURCE[0]}")/../../db-functions"
signpkg() {
if [[ -r '/etc/makepkg.conf' ]]; then
@@ -15,9 +15,9 @@ signpkg() {
. ~/.makepkg.conf
fi
if [[ -n $GPGKEY ]]; then
- SIGNWITHKEY="-u ${GPGKEY}"
+ SIGNWITHKEY=(-u "${GPGKEY}")
fi
- gpg --detach-sign --use-agent ${SIGNWITHKEY} ${@} || die
+ gpg --detach-sign --use-agent "${SIGNWITHKEY[@]}" "${@}" || die
}
oneTimeSetUp() {
@@ -28,33 +28,33 @@ oneTimeSetUp() {
local pkgarch
local pkgversion
local build
- pkgdir="$(mktemp -d /tmp/${0##*/}.XXXXXXXXXX)"
- cp -Lr $(dirname ${BASH_SOURCE[0]})/../packages/* "${pkgdir}"
+ pkgdir="$(mktemp -d "/tmp/${0##*/}.XXXXXXXXXX")"
+ cp -Lr "$(dirname "${BASH_SOURCE[0]}")"/../packages/* "${pkgdir}"
msg 'Building packages...'
for d in "${pkgdir}"/*; do
- pushd $d >/dev/null
- pkgname=($(. PKGBUILD; echo ${pkgname[@]}))
- pkgarch=($(. PKGBUILD; echo ${arch[@]}))
- pkgversion=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}))
+ pushd "$d" >/dev/null
+ pkgname=($(. PKGBUILD; echo "${pkgname[@]}"))
+ pkgarch=($(. PKGBUILD; echo "${arch[@]}"))
+ pkgversion=$(. PKGBUILD; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}")
build=true
- for a in ${pkgarch[@]}; do
- for p in ${pkgname[@]}; do
- [ ! -f ${p}-${pkgversion}-${a}${PKGEXT} ] && build=false
+ for a in "${pkgarch[@]}"; do
+ for p in "${pkgname[@]}"; do
+ [ ! -f "${p}-${pkgversion}-${a}"${PKGEXT} ] && build=false
done
done
- if ! ${build}; then
+ if ! "${build}"; then
if [ "${pkgarch[0]}" == 'any' ]; then
sudo extra-x86_64-build || die 'extra-x86_64-build failed'
else
- for a in ${pkgarch[@]}; do
- sudo extra-${a}-build || die "extra-${a}-build failed"
+ for a in "${pkgarch[@]}"; do
+ sudo "extra-${a}-build" || die "extra-${a}-build failed"
done
fi
- for a in ${pkgarch[@]}; do
- for p in ${pkgname[@]}; do
- cp ${p}-${pkgversion}-${a}${PKGEXT} $(dirname ${BASH_SOURCE[0]})/../packages/${d##*/}
+ for a in "${pkgarch[@]}"; do
+ for p in "${pkgname[@]}"; do
+ cp "${p}-${pkgversion}-${a}"${PKGEXT} "$(dirname "${BASH_SOURCE[0]}")/../packages/${d##*/}"
done
done
fi
@@ -72,17 +72,17 @@ setUp() {
local r
local a
- [ -f "$(dirname ${BASH_SOURCE[0]})/../../config.local" ] && die "$(dirname ${BASH_SOURCE[0]})/../../config.local exists"
- TMP="$(mktemp -d /tmp/${0##*/}.XXXXXXXXXX)"
+ [ -f "$(dirname "${BASH_SOURCE[0]}")/../../config.local" ] && die "$(dirname "${BASH_SOURCE[0]}")/../../config.local exists"
+ TMP="$(mktemp -d "/tmp/${0##*/}.XXXXXXXXXX")"
#msg "Using ${TMP}"
PKGREPOS=('core' 'extra' 'testing')
PKGPOOL='pool/packages'
mkdir -p "${TMP}/"{ftp,tmp,staging,{package,source}-cleanup,svn-packages-{copy,repo}}
- for r in ${PKGREPOS[@]}; do
+ for r in "${PKGREPOS[@]}"; do
mkdir -p "${TMP}/staging/${r}"
- for a in ${ARCHES[@]}; do
+ for a in "${ARCHES[@]}"; do
mkdir -p "${TMP}/ftp/${r}/os/${a}"
done
done
@@ -96,15 +96,15 @@ setUp() {
for p in "${pkgdir}"/*; do
pkg=${p##*/}
mkdir -p "${TMP}/svn-packages-copy/${pkg}"/{trunk,repos}
- cp "${p}"/* "${TMP}/svn-packages-copy"/${pkg}/trunk/
- arch_svn add -q "${TMP}/svn-packages-copy"/${pkg}
+ cp "${p}"/* "${TMP}/svn-packages-copy/${pkg}/trunk/"
+ arch_svn add -q "${TMP}/svn-packages-copy/${pkg}"
arch_svn commit -q -m"initial commit of ${pkg}" "${TMP}/svn-packages-copy"
done
- cat <<eot > "$(dirname ${BASH_SOURCE[0]})/../../config.local"
+ cat <<eot > "$(dirname "${BASH_SOURCE[0]}")/../../config.local"
FTP_BASE="${TMP}/ftp"
SVNREPO="file://${TMP}/svn-packages-repo"
- PKGREPOS=(${PKGREPOS[@]})
+ PKGREPOS=("${PKGREPOS[@]}")
PKGPOOL="${PKGPOOL}"
TESTING_REPO='testing'
STABLE_REPOS=('core' 'extra')
@@ -116,12 +116,12 @@ setUp() {
SOURCE_CLEANUP_DRYRUN=false
REQUIRE_SIGNATURE=true
eot
- . "$(dirname ${BASH_SOURCE[0]})/../../config"
+ . "$(dirname "${BASH_SOURCE[0]}")/../../config"
}
tearDown() {
rm -rf "${TMP}"
- rm -f "$(dirname ${BASH_SOURCE[0]})/../../config.local"
+ rm -f "$(dirname "${BASH_SOURCE[0]}")/../../config.local"
echo
}
@@ -134,17 +134,17 @@ releasePackage() {
local pkgver
local pkgname
- pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null
- archrelease ${repo}-${arch} >/dev/null 2>&1
- pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}))
- pkgname=($(. PKGBUILD; echo ${pkgname[@]}))
+ pushd "${TMP}/svn-packages-copy/${pkgbase}/trunk/" >/dev/null
+ archrelease "${repo}-${arch}" >/dev/null 2>&1
+ pkgver=$(. PKGBUILD; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}")
+ pkgname=($(. PKGBUILD; echo "${pkgname[@]}"))
popd >/dev/null
- cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${PKGEXT} "${STAGING}"/${repo}/
+ cp "${pkgdir}/${pkgbase}"/*-"${pkgver}-${arch}"${PKGEXT} "${STAGING}/${repo}/"
- if ${REQUIRE_SIGNATURE}; then
- for a in ${arch[@]}; do
- for p in ${pkgname[@]}; do
- signpkg "${STAGING}"/${repo}/${p}-${pkgver}-${a}${PKGEXT}
+ if "${REQUIRE_SIGNATURE}"; then
+ for a in "${arch[@]}"; do
+ for p in "${pkgname[@]}"; do
+ signpkg "${STAGING}/${repo}/${p}-${pkgver}-${a}"${PKGEXT}
done
done
fi
@@ -157,7 +157,7 @@ checkAnyPackageDB() {
local db
[ -r "${FTP_BASE}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found"
- if ${REQUIRE_SIGNATURE}; then
+ if "${REQUIRE_SIGNATURE}"; then
[ -r "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found"
fi
@@ -166,27 +166,27 @@ checkAnyPackageDB() {
[ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}")" == "${FTP_BASE}/${PKGPOOL}/${pkg}" ] \
|| fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}"
- if ${REQUIRE_SIGNATURE}; then
+ if "${REQUIRE_SIGNATURE}"; then
[ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink"
[ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig")" == "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] \
|| fail "${repo}/os/${arch}/${pkg}.sig does not link to ${PKGPOOL}/${pkg}.sig"
fi
- for db in ${DBEXT} ${FILESEXT}; do
+ for db in "${DBEXT}" "${FILESEXT}"; do
( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \
+ && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q "${pkg}") \
|| fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
done
- [ -r "${STAGING}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging dir"
- [ -r "${STAGING}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging dir"
+ [ -r "${STAGING}/${repo}/${pkg}" ] && fail "${repo}/${pkg} found in staging dir"
+ [ -r "${STAGING}/${repo}/${pkg}".sig ] && fail "${repo}/${pkg}.sig found in staging dir"
}
checkAnyPackage() {
local repo=$1
local pkg=$2
- checkAnyPackageDB $repo $pkg
+ checkAnyPackageDB "$repo" "$pkg"
local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}")
arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
@@ -202,23 +202,23 @@ checkPackageDB() {
[ -r "${FTP_BASE}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found"
[ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}" ] || fail "${repo}/os/${arch}/${pkg} not a symlink"
- [ -r "${STAGING}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging dir"
+ [ -r "${STAGING}/${repo}/${pkg}" ] && fail "${repo}/${pkg} found in staging dir"
[ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}")" == "${FTP_BASE}/${PKGPOOL}/${pkg}" ] \
|| fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}"
- if ${REQUIRE_SIGNATURE}; then
+ if "${REQUIRE_SIGNATURE}"; then
[ -r "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found"
[ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink"
- [ -r "${STAGING}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging dir"
+ [ -r "${STAGING}/${repo}/${pkg}.sig" ] && fail "${repo}/${pkg}.sig found in staging dir"
[ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}.sig")" == "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] \
|| fail "${repo}/os/${arch}/${pkg}.sig does not link to ${PKGPOOL}/${pkg}.sig"
fi
- for db in ${DBEXT} ${FILESEXT}; do
+ for db in "${DBEXT}" "${FILESEXT}"; do
( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \
+ && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q "${pkg}") \
|| fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
}
@@ -228,7 +228,7 @@ checkPackage() {
local pkg=$2
local arch=$3
- checkPackageDB $repo $pkg $arch
+ checkPackageDB "$repo" "$pkg" "$arch"
local pkgbase=$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${pkg}")
arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
@@ -242,9 +242,9 @@ checkRemovedPackageDB() {
local arch=$3
local db
- for db in ${DBEXT} ${FILESEXT}; do
+ for db in "${DBEXT}" "${FILESEXT}"; do
( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \
+ && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q "${pkgbase}") \
&& fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
}
@@ -254,7 +254,7 @@ checkRemovedPackage() {
local pkgbase=$2
local arch=$3
- checkRemovedPackageDB $repo $pkgbase $arch
+ checkRemovedPackageDB "$repo" "$pkgbase" "$arch"
arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
[ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \
@@ -267,10 +267,10 @@ checkRemovedAnyPackageDB() {
local arch
local db
- for db in ${DBEXT} ${FILESEXT}; do
+ for db in "${DBEXT}" "${FILESEXT}"; do
for arch in i686 x86_64; do
( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \
+ && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q "${pkgbase}") \
&& fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}"
done
done
@@ -280,7 +280,7 @@ checkRemovedAnyPackage() {
local repo=$1
local pkgbase=$2
- checkRemovedAnyPackageDB $repo $pkgbase
+ checkRemovedAnyPackageDB "$repo" "$pkgbase"
arch_svn up -q "${TMP}/svn-packages-copy/${pkgbase}"
[ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \
diff --git a/test/packages/pkg-any-a/PKGBUILD b/test/packages/pkg-any-a/PKGBUILD
index 8749a35..cd5d66f 100644
--- a/test/packages/pkg-any-a/PKGBUILD
+++ b/test/packages/pkg-any-a/PKGBUILD
@@ -7,6 +7,6 @@ url='http://www.archlinux.org/'
license=('GPL')
package() {
- install -d -m755 ${pkgdir}/usr/share/${pkgname}
- echo 'test' > ${pkgdir}/usr/share/${pkgname}/test
+ install -d -m755 "${pkgdir}"/usr/share/${pkgname}
+ echo 'test' > "${pkgdir}"/usr/share/${pkgname}/test
}
diff --git a/test/packages/pkg-any-b/PKGBUILD b/test/packages/pkg-any-b/PKGBUILD
index e6a0498..90794fc 100644
--- a/test/packages/pkg-any-b/PKGBUILD
+++ b/test/packages/pkg-any-b/PKGBUILD
@@ -7,6 +7,6 @@ url='http://www.archlinux.org/'
license=('GPL')
package() {
- install -d -m755 ${pkgdir}/usr/share/${pkgname}
- echo 'test' > ${pkgdir}/usr/share/${pkgname}/test
+ install -d -m755 "${pkgdir}"/usr/share/${pkgname}
+ echo 'test' > "${pkgdir}"/usr/share/${pkgname}/test
}
diff --git a/test/packages/pkg-simple-a/PKGBUILD b/test/packages/pkg-simple-a/PKGBUILD
index 953ecfa..9b4478e 100644
--- a/test/packages/pkg-simple-a/PKGBUILD
+++ b/test/packages/pkg-simple-a/PKGBUILD
@@ -12,11 +12,11 @@ md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
'3c1e4279feb678fd9cabaccdb28e40d0')
build() {
- cd ${srcdir}
+ cd "${srcdir}"
make
}
package() {
- cd ${srcdir}
- make install DESTDIR=${pkgdir} DESTBIN=${pkgname}
+ cd "${srcdir}"
+ make install DESTDIR="${pkgdir}" DESTBIN="${pkgname}"
}
diff --git a/test/packages/pkg-simple-b/PKGBUILD b/test/packages/pkg-simple-b/PKGBUILD
index 95ffd09..4a9e58d 100644
--- a/test/packages/pkg-simple-b/PKGBUILD
+++ b/test/packages/pkg-simple-b/PKGBUILD
@@ -12,11 +12,11 @@ md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
'3c1e4279feb678fd9cabaccdb28e40d0')
build() {
- cd ${srcdir}
+ cd "${srcdir}"
make
}
package() {
- cd ${srcdir}
- make install DESTDIR=${pkgdir} DESTBIN=${pkgname}
+ cd "${srcdir}"
+ make install DESTDIR="${pkgdir}" DESTBIN="${pkgname}"
}
diff --git a/test/packages/pkg-simple-epoch/PKGBUILD b/test/packages/pkg-simple-epoch/PKGBUILD
index eebe2bd..0761b32 100644
--- a/test/packages/pkg-simple-epoch/PKGBUILD
+++ b/test/packages/pkg-simple-epoch/PKGBUILD
@@ -13,11 +13,11 @@ md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
'3c1e4279feb678fd9cabaccdb28e40d0')
build() {
- cd ${srcdir}
+ cd "${srcdir}"
make
}
package() {
- cd ${srcdir}
- make install DESTDIR=${pkgdir} DESTBIN=${pkgname}
+ cd "${srcdir}"
+ make install DESTDIR="${pkgdir}" DESTBIN="${pkgname}"
}
diff --git a/test/packages/pkg-split-a/PKGBUILD b/test/packages/pkg-split-a/PKGBUILD
index e941976..f7a0576 100644
--- a/test/packages/pkg-split-a/PKGBUILD
+++ b/test/packages/pkg-split-a/PKGBUILD
@@ -13,16 +13,16 @@ md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
'3c1e4279feb678fd9cabaccdb28e40d0')
build() {
- cd ${srcdir}
+ cd "${srcdir}"
make
}
package_pkg-split-a1() {
- cd ${srcdir}
- make install DESTDIR=${pkgdir} DESTBIN=${pkgname[0]}
+ cd "${srcdir}"
+ make install DESTDIR="${pkgdir}" DESTBIN="${pkgname[0]}"
}
package_pkg-split-a2() {
- cd ${srcdir}
- make install DESTDIR=${pkgdir} DESTBIN=${pkgname[1]}
+ cd "${srcdir}"
+ make install DESTDIR="${pkgdir}" DESTBIN="${pkgname[1]}"
}
diff --git a/test/packages/pkg-split-b/PKGBUILD b/test/packages/pkg-split-b/PKGBUILD
index 6ddbc45..3bd635c 100644
--- a/test/packages/pkg-split-b/PKGBUILD
+++ b/test/packages/pkg-split-b/PKGBUILD
@@ -14,16 +14,16 @@ md5sums=('c6cb8dcc86253355fed559416d0c8dcf'
'3c1e4279feb678fd9cabaccdb28e40d0')
build() {
- cd ${srcdir}
+ cd "${srcdir}"
make
}
package_pkg-split-b1() {
- cd ${srcdir}
- make install DESTDIR=${pkgdir} DESTBIN=${pkgname[0]}
+ cd "${srcdir}"
+ make install DESTDIR="${pkgdir}" DESTBIN="${pkgname[0]}"
}
package_pkg-split-b2() {
- cd ${srcdir}
- make install DESTDIR=${pkgdir} DESTBIN=${pkgname[1]}
+ cd "${srcdir}"
+ make install DESTDIR="${pkgdir}" DESTBIN="${pkgname[1]}"
}
diff --git a/test/runTest b/test/runTest
index b8713d8..7163e30 100755
--- a/test/runTest
+++ b/test/runTest
@@ -1,12 +1,12 @@
#!/bin/bash
-. "$(dirname ${BASH_SOURCE[0]})/lib/common.inc"
+. "$(dirname "${BASH_SOURCE[0]}")/lib/common.inc"
-for t in "$(dirname ${BASH_SOURCE[0]})/test.d/"*.sh; do
- l=$(basename ${t} .sh)
- if [ -x ${t} ]; then
+for t in "$(dirname "${BASH_SOURCE[0]}")/test.d/"*.sh; do
+ l=$(basename "${t}" .sh)
+ if [ -x "${t}" ]; then
msg "Running test '${l}'"
- ${t}
+ "${t}"
[ $? -ne 0 ] && die "Test '${l}' failed"
echo -e "\n\n\n"
else
diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh
index 49734c4..e3a30d1 100755
--- a/test/test.d/create-filelists.sh
+++ b/test/test.d/create-filelists.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testCreateSimpleFileLists() {
@@ -9,15 +9,15 @@ testCreateSimpleFileLists() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgbase}"; then
fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}"
fi
@@ -31,13 +31,13 @@ testCreateAnyFileLists() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- releasePackage extra ${pkgbase} any
+ for pkgbase in "${pkgs[@]}"; do
+ releasePackage extra "${pkgbase}" any
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/share/${pkgbase}/test"; then
fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}"
fi
@@ -54,17 +54,17 @@ testCreateSplitFileLists() {
local pkgnames
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for pkgbase in ${pkgs[@]}; do
+ for pkgbase in "${pkgs[@]}"; do
pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]}))
- for pkgname in ${pkgnames[@]}; do
- for arch in ${arches[@]}; do
+ for pkgname in "${pkgnames[@]}"; do
+ for arch in "${arches[@]}"; do
if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then
fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}"
fi
@@ -80,18 +80,18 @@ testCleanupFileLists() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for arch in ${arches[@]}; do
- ../db-remove extra ${arch} pkg-simple-a
+ for arch in "${arches[@]}"; do
+ ../db-remove extra "${arch}" pkg-simple-a
done
- for arch in ${arches[@]}; do
+ for arch in "${arches[@]}"; do
if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-b"; then
fail "usr/bin/pkg-simple-b not found in ${arch}/extra${FILESEXT}"
fi
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
diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh
index 416e693..fca480c 100755
--- a/test/test.d/db-remove.sh
+++ b/test/test.d/db-remove.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testRemovePackages() {
@@ -9,23 +9,23 @@ testRemovePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- ../db-remove extra ${arch} ${pkgbase}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ ../db-remove extra "${arch}" "${pkgbase}"
done
done
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkRemovedPackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ checkRemovedPackage extra "${pkgbase}" "${arch}"
done
done
}
@@ -36,21 +36,21 @@ testRemoveMultiplePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for arch in ${arches[@]}; do
- ../db-remove extra ${arch} ${pkgs[@]}
+ for arch in "${arches[@]}"; do
+ ../db-remove extra "${arch}" "${pkgs[@]}"
done
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkRemovedPackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ checkRemovedPackage extra "${pkgbase}" "${arch}"
done
done
}
@@ -59,18 +59,18 @@ testRemoveAnyPackages() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
- for pkgbase in ${pkgs[@]}; do
- releasePackage extra ${pkgbase} any
+ for pkgbase in "${pkgs[@]}"; do
+ releasePackage extra "${pkgbase}" any
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- ../db-remove extra any ${pkgbase}
+ for pkgbase in "${pkgs[@]}"; do
+ ../db-remove extra any "${pkgbase}"
done
- for pkgbase in ${pkgs[@]}; do
- checkRemovedAnyPackage extra ${pkgbase}
+ for pkgbase in "${pkgs[@]}"; do
+ checkRemovedAnyPackage extra "${pkgbase}"
done
}
diff --git a/test/test.d/db-repo-add.sh b/test/test.d/db-repo-add.sh
index 8603104..3d83007 100755
--- a/test/test.d/db-repo-add.sh
+++ b/test/test.d/db-repo-add.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testAddSimplePackages() {
@@ -9,19 +9,19 @@ testAddSimplePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
cp "${pkgdir}/${pkgbase}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/${PKGPOOL}/"
touch "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig"
ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/extra/os/${arch}/"
ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig" "${FTP_BASE}/extra/os/${arch}/"
- ../db-repo-add extra ${arch} ${pkgbase}-1-1-${arch}.pkg.tar.xz
+ ../db-repo-add extra "${arch}" "${pkgbase}-1-1-${arch}.pkg.tar.xz"
done
done
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkPackageDB extra ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ checkPackageDB extra "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}"
done
done
}
@@ -32,21 +32,21 @@ testAddMultiplePackages() {
local pkgbase
local arch
- for arch in ${arches[@]}; do
+ for arch in "${arches[@]}"; do
add_pkgs=()
- for pkgbase in ${pkgs[@]}; do
+ for pkgbase in "${pkgs[@]}"; do
cp "${pkgdir}/${pkgbase}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/${PKGPOOL}/"
touch "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig"
ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/extra/os/${arch}/"
ln -s "${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-${arch}.pkg.tar.xz.sig" "${FTP_BASE}/extra/os/${arch}/"
- add_pkgs[${#add_pkgs[*]}]=${pkgbase}-1-1-${arch}.pkg.tar.xz
+ add_pkgs+=("${pkgbase}-1-1-${arch}.pkg.tar.xz")
done
- ../db-repo-add extra ${arch} ${add_pkgs[@]}
+ ../db-repo-add extra "${arch}" "${add_pkgs[@]}"
done
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkPackageDB extra ${pkgbase}-1-1-${arch}.pkg.tar.xz ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ checkPackageDB extra "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}"
done
done
}
diff --git a/test/test.d/db-repo-remove.sh b/test/test.d/db-repo-remove.sh
index 315d63d..ce13280 100755
--- a/test/test.d/db-repo-remove.sh
+++ b/test/test.d/db-repo-remove.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testRemovePackages() {
@@ -9,23 +9,23 @@ testRemovePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- ../db-repo-remove extra ${arch} ${pkgbase}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ ../db-repo-remove extra "${arch}" "${pkgbase}"
done
done
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkRemovedPackageDB extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ checkRemovedPackageDB extra "${pkgbase}" "${arch}"
done
done
}
@@ -36,21 +36,21 @@ testRemoveMultiplePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for arch in ${arches[@]}; do
- ../db-repo-remove extra ${arch} ${pkgs[@]}
+ for arch in "${arches[@]}"; do
+ ../db-repo-remove extra "${arch}" "${pkgs[@]}"
done
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkRemovedPackageDB extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ checkRemovedPackageDB extra "${pkgbase}" "${arch}"
done
done
}
diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh
index 7a5ce4c..c83d51b 100755
--- a/test/test.d/db-update.sh
+++ b/test/test.d/db-update.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testAddSimplePackages() {
@@ -9,17 +9,17 @@ testAddSimplePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- checkPackage extra ${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}"
done
done
}
@@ -40,14 +40,14 @@ testAddAnyPackages() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
- for pkgbase in ${pkgs[@]}; do
- releasePackage extra ${pkgbase} any
+ for pkgbase in "${pkgs[@]}"; do
+ releasePackage extra "${pkgbase}" any
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- checkAnyPackage extra ${pkgbase}-1-1-any.pkg.tar.xz
+ for pkgbase in "${pkgs[@]}"; do
+ checkAnyPackage extra "${pkgbase}-1-1-any.pkg.tar.xz"
done
}
@@ -58,18 +58,18 @@ testAddSplitPackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do
- checkPackage extra ${pkg##*/} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ for pkg in "${pkgdir}/${pkgbase}"/*-"${arch}"${PKGEXT}; do
+ checkPackage extra "${pkg##*/}" "${arch}"
done
done
done
@@ -134,7 +134,7 @@ testUpdateSameAnyPackageToDifferentRepositories() {
local arch
for arch in i686 x86_64; do
( [ -r "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \
+ && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q "${pkgbase}") \
&& fail "${pkgbase} should not be in testing/os/${arch}/testing${DBEXT%.tar.*}"
done
}
@@ -146,18 +146,18 @@ testAddIncompleteSplitPackage() {
local pkgbase='pkg-split-a'
local arch
- for arch in ${arches[@]}; do
- releasePackage ${repo} ${pkgbase} ${arch}
+ for arch in "${arches[@]}"; do
+ releasePackage "${repo}" "${pkgbase}" "${arch}"
done
# remove a split package to make db-update fail
- rm "${STAGING}"/extra/${pkgbase}1-*
+ rm "${STAGING}/extra/${pkgbase}1-"*
../db-update >/dev/null 2>&1 && fail "db-update should fail when a split package is missing!"
- for arch in ${arches[@]}; do
+ for arch in "${arches[@]}"; do
( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \
- && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \
+ && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q "${pkgbase}") \
&& fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}"
done
}
diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh
index bfea7ea..1b075da 100755
--- a/test/test.d/ftpdir-cleanup.sh
+++ b/test/test.d/ftpdir-cleanup.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testCleanupSimplePackages() {
@@ -9,28 +9,28 @@ testCleanupSimplePackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for arch in ${arches[@]}; do
- ../db-remove extra ${arch} pkg-simple-a
+ for arch in "${arches[@]}"; do
+ ../db-remove extra "${arch}" pkg-simple-a
done
../cron-jobs/ftpdir-cleanup >/dev/null
- for arch in ${arches[@]}; do
+ for arch in "${arches[@]}"; do
local pkg1="pkg-simple-a-1-1-${arch}.pkg.tar.xz"
- checkRemovedPackage extra 'pkg-simple-a' ${arch}
+ checkRemovedPackage extra 'pkg-simple-a' "${arch}"
[ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found"
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg1}" ] && fail "${repo}/os/${arch}/${pkg1} found"
local pkg2="pkg-simple-b-1-1-${arch}.pkg.tar.xz"
- checkPackage extra ${pkg2} ${arch}
+ checkPackage extra "${pkg2}" "${arch}"
done
}
@@ -40,23 +40,23 @@ testCleanupEpochPackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for arch in ${arches[@]}; do
- ../db-remove extra ${arch} pkg-simple-epoch
+ for arch in "${arches[@]}"; do
+ ../db-remove extra "${arch}" pkg-simple-epoch
done
../cron-jobs/ftpdir-cleanup >/dev/null
- for arch in ${arches[@]}; do
+ for arch in "${arches[@]}"; do
local pkg1="pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz"
- checkRemovedPackage extra 'pkg-simple-epoch' ${arch}
+ checkRemovedPackage extra 'pkg-simple-epoch' "${arch}"
[ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found"
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg1}" ] && fail "${repo}/os/${arch}/${pkg1} found"
done
@@ -67,8 +67,8 @@ testCleanupAnyPackages() {
local pkgbase
local arch='any'
- for pkgbase in ${pkgs[@]}; do
- releasePackage extra ${pkgbase} any
+ for pkgbase in "${pkgs[@]}"; do
+ releasePackage extra "${pkgbase}" any
done
../db-update
@@ -81,7 +81,7 @@ testCleanupAnyPackages() {
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg1}" ] && fail "${repo}/os/${arch}/${pkg1} found"
local pkg2="pkg-any-b-1-1-${arch}.pkg.tar.xz"
- checkAnyPackage extra ${pkg2}
+ checkAnyPackage extra "${pkg2}"
}
testCleanupSplitPackages() {
@@ -91,29 +91,29 @@ testCleanupSplitPackages() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
- for arch in ${arches[@]}; do
- ../db-remove extra ${arch} ${pkgs[0]}
+ for arch in "${arches[@]}"; do
+ ../db-remove extra "${arch}" "${pkgs[0]}"
done
../cron-jobs/ftpdir-cleanup >/dev/null
- for arch in ${arches[@]}; do
- for pkg in "${pkgdir}/${pkgs[0]}"/*-${arch}${PKGEXT}; do
- checkRemovedPackage extra ${pkgs[0]} ${arch}
+ for arch in "${arches[@]}"; do
+ for pkg in "${pkgdir}/${pkgs[0]}"/*-"${arch}"${PKGEXT}; do
+ checkRemovedPackage extra "${pkgs[0]}" "${arch}"
[ -f "${FTP_BASE}/${PKGPOOL}/${pkg}" ] && fail "${PKGPOOL}/${pkg} found"
[ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg}" ] && fail "${repo}/os/${arch}/${pkg} found"
done
- for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}${PKGEXT}; do
- checkPackage extra ${pkg##*/} ${arch}
+ for pkg in "${pkgdir}/${pkgs[1]}"/*-"${arch}"${PKGEXT}; do
+ checkPackage extra "${pkg##*/}" "${arch}"
done
done
}
diff --git a/test/test.d/packages.sh b/test/test.d/packages.sh
index 488cb15..1a31a41 100755
--- a/test/test.d/packages.sh
+++ b/test/test.d/packages.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testPackages() {
diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh
index 03566ef..4eccb41 100755
--- a/test/test.d/signed-packages.sh
+++ b/test/test.d/signed-packages.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testAddSignedPackage() {
@@ -18,8 +18,8 @@ testAddInvalidSignedPackage() {
local p
releasePackage extra 'pkg-simple-a' 'i686'
for p in "${STAGING}"/extra/*${PKGEXT}; do
- unxz $p
- xz -0 ${p%%.xz}
+ unxz "$p"
+ xz -0 "${p%%.xz}"
done
../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is invalid!"
}
@@ -28,7 +28,7 @@ testAddBrokenSignature() {
local s
releasePackage extra 'pkg-simple-a' 'i686'
for s in "${STAGING}"/extra/*.sig; do
- echo 0 > $s
+ echo 0 > "$s"
done
../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is broken!"
}
diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh
index fdcf08c..1097ae0 100755
--- a/test/test.d/sourceballs.sh
+++ b/test/test.d/sourceballs.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testSourceballs() {
@@ -9,16 +9,16 @@ testSourceballs() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
../cron-jobs/sourceballs
- for pkgbase in ${pkgs[@]}; do
- [ ! -r ${FTP_BASE}/${SRCPOOL}/${pkgbase}-*${SRCEXT} ] && fail "source package not found!"
+ for pkgbase in "${pkgs[@]}"; do
+ [ ! -r "${FTP_BASE}/${SRCPOOL}/${pkgbase}"-*"${SRCEXT}" ] && fail "source package not found!"
done
}
@@ -26,14 +26,14 @@ testAnySourceballs() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
- for pkgbase in ${pkgs[@]}; do
- releasePackage extra ${pkgbase} any
+ for pkgbase in "${pkgs[@]}"; do
+ releasePackage extra "${pkgbase}" any
done
../db-update
../cron-jobs/sourceballs
- for pkgbase in ${pkgs[@]}; do
- [ ! -r ${FTP_BASE}/${SRCPOOL}/${pkgbase}-*${SRCEXT} ] && fail "source package not found!"
+ for pkgbase in "${pkgs[@]}"; do
+ [ ! -r "${FTP_BASE}/${SRCPOOL}/${pkgbase}"-*"${SRCEXT}" ] && fail "source package not found!"
done
}
@@ -44,17 +44,17 @@ testSplitSourceballs() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
../cron-jobs/sourceballs
- for pkgbase in ${pkgs[@]}; do
- [ ! -r ${FTP_BASE}/${SRCPOOL}/${pkgbase}-*${SRCEXT} ] && fail "source package not found!"
+ for pkgbase in "${pkgs[@]}"; do
+ [ ! -r "${FTP_BASE}/${SRCPOOL}/${pkgbase}"-*"${SRCEXT}" ] && fail "source package not found!"
done
}
@@ -64,21 +64,21 @@ testSourceballsCleanup() {
local pkgbase
local arch
- for pkgbase in ${pkgs[@]}; do
- for arch in ${arches[@]}; do
- releasePackage extra ${pkgbase} ${arch}
+ for pkgbase in "${pkgs[@]}"; do
+ for arch in "${arches[@]}"; do
+ releasePackage extra "${pkgbase}" "${arch}"
done
done
../db-update
../cron-jobs/sourceballs
- for arch in ${arches[@]}; do
- ../db-remove extra ${arch} pkg-simple-a
+ for arch in "${arches[@]}"; do
+ ../db-remove extra "${arch}" pkg-simple-a
done
../cron-jobs/sourceballs
- [ -r ${FTP_BASE}/${SRCPOOL}/pkg-simple-a-*${SRCEXT} ] && fail "source package was not removed!"
- [ ! -r ${FTP_BASE}/${SRCPOOL}/pkg-simple-b-*${SRCEXT} ] && fail "source package not found!"
+ [ -r "${FTP_BASE}/${SRCPOOL}/pkg-simple-a"-*"${SRCEXT}" ] && fail "source package was not removed!"
+ [ ! -r "${FTP_BASE}/${SRCPOOL}/pkg-simple-b"-*"${SRCEXT}" ] && fail "source package not found!"
}
. "${curdir}/../lib/shunit2"
diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh
index 31d85b4..3bbd353 100755
--- a/test/test.d/testing2x.sh
+++ b/test/test.d/testing2x.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-curdir=$(readlink -e $(dirname $0))
+curdir=$(readlink -e "$(dirname "$0")")
. "${curdir}/../lib/common.inc"
testTesting2xAnyPackage() {