From 7850874b1ef1b18de585be108e3be899d95a3a2a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 12:07:09 -0400 Subject: 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 '(?/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 < "$(dirname ${BASH_SOURCE[0]})/../../config.local" + cat < "$(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() { -- cgit v1.2.3-2-g168b From 6c36c3fac724435328d1ba3df47b435087ef9795 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 17 May 2015 18:00:00 -0400 Subject: test/: make TMPDIR configurable via config.testing Because common.inc is included in nested calls, to prevent later calls from overriding earlier calls, we export MASTER_TMPDIR to signal the top-level value. Calls to mktemp have also bee adjusted to obey TMPDIR. --- test/lib/common.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/lib/common.inc b/test/lib/common.inc index bb3db5b..9a7e4d9 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -1,8 +1,7 @@ set -E . "$(dirname "${BASH_SOURCE[0]}")/../../config" -# override the default TMPDIR -TMPDIR="$(mktemp -d "/tmp/${0##*/}.XXXXXXXXXX")" +. "$(dirname "${BASH_SOURCE[0]}")/../../config.testing" . "$(dirname "${BASH_SOURCE[0]}")/../../db-functions" signpkg() { @@ -28,7 +27,7 @@ oneTimeSetUp() { local pkgarch local pkgversion local build - pkgdir="$(mktemp -d "/tmp/${0##*/}.XXXXXXXXXX")" + pkgdir="$(mktemp -dt "${0##*/}.XXXXXXXXXX")" cp -Lr "$(dirname "${BASH_SOURCE[0]}")"/../packages/* "${pkgdir}" msg 'Building packages...' for d in "${pkgdir}"/*; do @@ -73,7 +72,7 @@ setUp() { local a [ -f "$(dirname "${BASH_SOURCE[0]}")/../../config.local" ] && die "$(dirname "${BASH_SOURCE[0]}")/../../config.local exists" - TMP="$(mktemp -d "/tmp/${0##*/}.XXXXXXXXXX")" + TMP="$(mktemp -dt "${0##*/}.XXXXXXXXXX")" #msg "Using ${TMP}" PKGREPOS=('core' 'extra' 'testing') -- cgit v1.2.3-2-g168b From db673811e674dc246fefa432d205f67ef3c56dbc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 17 May 2015 18:02:50 -0400 Subject: test/: Make which architectures to build for configurable. --- test/lib/common.inc | 16 ++++++++++------ test/test.d/create-filelists.sh | 20 ++++++++------------ test/test.d/db-move.sh | 22 +++++++++------------- test/test.d/db-remove.sh | 14 ++++++-------- test/test.d/db-repo-add.sh | 10 ++++------ test/test.d/db-repo-remove.sh | 14 ++++++-------- test/test.d/db-update.sh | 15 ++++++--------- test/test.d/ftpdir-cleanup.sh | 21 +++++++++------------ test/test.d/sourceballs.sh | 11 ++++------- 9 files changed, 62 insertions(+), 81 deletions(-) (limited to 'test') diff --git a/test/lib/common.inc b/test/lib/common.inc index 9a7e4d9..5b06616 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -48,13 +48,17 @@ oneTimeSetUp() { 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" + if in_array "$a" "${ARCH_BUILD[@]}"; then + sudo "extra-${a}-build" || die "extra-${a}-build failed" + fi done fi for a in "${pkgarch[@]}"; do - for p in "${pkgname[@]}"; do - cp "${p}-${pkgversion}-${a}"${PKGEXT} "$(dirname "${BASH_SOURCE[0]}")/../packages/${d##*/}" - done + if in_array "$a" "${ARCH_BUILD[@]}"; then + for p in "${pkgname[@]}"; do + cp "${p}-${pkgversion}-${a}"${PKGEXT} "$(dirname "${BASH_SOURCE[0]}")/../packages/${d##*/}" + done + fi done fi popd >/dev/null @@ -160,7 +164,7 @@ checkAnyPackageDB() { [ -r "${FTP_BASE}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found" fi - for arch in i686 x86_64; do + for arch in "${ARCH_BUILD[@]}"; do [ -L "${FTP_BASE}/${repo}/os/${arch}/${pkg}" ] || fail "${repo}/os/${arch}/${pkg} is not a symlink" [ "$(readlink -e "${FTP_BASE}/${repo}/os/${arch}/${pkg}")" == "${FTP_BASE}/${PKGPOOL}/${pkg}" ] \ || fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}" @@ -267,7 +271,7 @@ checkRemovedAnyPackageDB() { local db for db in "${DBEXT}" "${FILESEXT}"; do - for arch in i686 x86_64; do + for arch in "${ARCH_BUILD[@]}"; do ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \ && 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.*}" diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index e3a30d1..e16a8d1 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -4,20 +4,19 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testCreateSimpleFileLists() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; 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 @@ -26,7 +25,6 @@ testCreateSimpleFileLists() { } testCreateAnyFileLists() { - local arches=('i686' 'x86_64') local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase local arch @@ -37,7 +35,7 @@ testCreateAnyFileLists() { ../db-update for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; 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 @@ -46,7 +44,6 @@ testCreateAnyFileLists() { } testCreateSplitFileLists() { - local arches=('i686' 'x86_64') local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase @@ -55,7 +52,7 @@ testCreateSplitFileLists() { local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done @@ -64,7 +61,7 @@ testCreateSplitFileLists() { 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 arch in "${ARCH_BUILD[@]}"; 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 @@ -75,23 +72,22 @@ testCreateSplitFileLists() { testCleanupFileLists() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-remove extra "${arch}" pkg-simple-a done - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; 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 e3207b6..410e222 100755 --- a/test/test.d/db-move.sh +++ b/test/test.d/db-move.sh @@ -4,13 +4,12 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testMoveSimplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage testing "${pkgbase}" "${arch}" done done @@ -19,7 +18,7 @@ testMoveSimplePackages() { ../db-move testing extra pkg-simple-a - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; 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}" @@ -28,13 +27,12 @@ testMoveSimplePackages() { } testMoveMultiplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage testing "${pkgbase}" "${arch}" done done @@ -44,7 +42,7 @@ testMoveMultiplePackages() { ../db-move testing extra pkg-simple-a pkg-simple-b for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do checkPackage extra "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}" checkRemovedPackage testing "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}" done @@ -52,13 +50,12 @@ testMoveMultiplePackages() { } testMoveEpochPackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage testing "${pkgbase}" "${arch}" done done @@ -67,7 +64,7 @@ testMoveEpochPackages() { ../db-move testing extra pkg-simple-epoch - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; 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 @@ -90,14 +87,13 @@ testMoveAnyPackages() { } testMoveSplitPackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage testing "${pkgbase}" "${arch}" done done @@ -105,12 +101,12 @@ testMoveSplitPackages() { ../db-update ../db-move testing extra pkg-split-a - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do for pkg in "${pkgdir}/pkg-split-a"/*-"${arch}"${PKGEXT}; do checkPackage extra "${pkg##*/}" "${arch}" done done - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do for pkg in "${pkgdir}/pkg-split-b"/*-"${arch}"${PKGEXT}; do checkPackage testing "${pkg##*/}" "${arch}" done diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh index fca480c..4fd5548 100755 --- a/test/test.d/db-remove.sh +++ b/test/test.d/db-remove.sh @@ -4,13 +4,12 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testRemovePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done @@ -18,38 +17,37 @@ testRemovePackages() { ../db-update for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-remove extra "${arch}" "${pkgbase}" done done for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do checkRemovedPackage extra "${pkgbase}" "${arch}" done done } testRemoveMultiplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-remove extra "${arch}" "${pkgs[@]}" done for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do checkRemovedPackage extra "${pkgbase}" "${arch}" done done diff --git a/test/test.d/db-repo-add.sh b/test/test.d/db-repo-add.sh index 3d83007..776c0a2 100755 --- a/test/test.d/db-repo-add.sh +++ b/test/test.d/db-repo-add.sh @@ -4,13 +4,12 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testAddSimplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; 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}/" @@ -20,19 +19,18 @@ testAddSimplePackages() { done for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do checkPackageDB extra "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}" done done } testAddMultiplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do add_pkgs=() for pkgbase in "${pkgs[@]}"; do cp "${pkgdir}/${pkgbase}/${pkgbase}-1-1-${arch}.pkg.tar.xz" "${FTP_BASE}/${PKGPOOL}/" @@ -45,7 +43,7 @@ testAddMultiplePackages() { done for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; 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 ce13280..fd69fa7 100755 --- a/test/test.d/db-repo-remove.sh +++ b/test/test.d/db-repo-remove.sh @@ -4,13 +4,12 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testRemovePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done @@ -18,38 +17,37 @@ testRemovePackages() { ../db-update for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-repo-remove extra "${arch}" "${pkgbase}" done done for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do checkRemovedPackageDB extra "${pkgbase}" "${arch}" done done } testRemoveMultiplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-repo-remove extra "${arch}" "${pkgs[@]}" done for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do checkRemovedPackageDB extra "${pkgbase}" "${arch}" done done diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index c83d51b..48c243d 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -4,13 +4,12 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testAddSimplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done @@ -18,7 +17,7 @@ testAddSimplePackages() { ../db-update for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do checkPackage extra "${pkgbase}-1-1-${arch}.pkg.tar.xz" "${arch}" done done @@ -52,14 +51,13 @@ testAddAnyPackages() { } testAddSplitPackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done @@ -67,7 +65,7 @@ testAddSplitPackages() { ../db-update for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do for pkg in "${pkgdir}/${pkgbase}"/*-"${arch}"${PKGEXT}; do checkPackage extra "${pkg##*/}" "${arch}" done @@ -141,12 +139,11 @@ testUpdateSameAnyPackageToDifferentRepositories() { testAddIncompleteSplitPackage() { - local arches=('i686' 'x86_64') local repo='extra' local pkgbase='pkg-split-a' local arch - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage "${repo}" "${pkgbase}" "${arch}" done @@ -155,7 +152,7 @@ testAddIncompleteSplitPackage() { ../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 "${ARCH_BUILD[@]}"; do ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \ && 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.*}" diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index 1b075da..6902b9b 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -4,26 +4,25 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testCleanupSimplePackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-remove extra "${arch}" pkg-simple-a done ../cron-jobs/ftpdir-cleanup >/dev/null - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do local pkg1="pkg-simple-a-1-1-${arch}.pkg.tar.xz" checkRemovedPackage extra 'pkg-simple-a' "${arch}" [ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found" @@ -35,26 +34,25 @@ testCleanupSimplePackages() { } testCleanupEpochPackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-remove extra "${arch}" pkg-simple-epoch done ../cron-jobs/ftpdir-cleanup >/dev/null - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do local pkg1="pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz" checkRemovedPackage extra 'pkg-simple-epoch' "${arch}" [ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found" @@ -85,27 +83,26 @@ testCleanupAnyPackages() { } testCleanupSplitPackages() { - local arches=('i686' 'x86_64') local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-remove extra "${arch}" "${pkgs[0]}" done ../cron-jobs/ftpdir-cleanup >/dev/null - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do for pkg in "${pkgdir}/${pkgs[0]}"/*-"${arch}"${PKGEXT}; do checkRemovedPackage extra "${pkgs[0]}" "${arch}" [ -f "${FTP_BASE}/${PKGPOOL}/${pkg}" ] && fail "${PKGPOOL}/${pkg} found" diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh index 1097ae0..561169e 100755 --- a/test/test.d/sourceballs.sh +++ b/test/test.d/sourceballs.sh @@ -4,13 +4,12 @@ curdir=$(readlink -e "$(dirname "$0")") . "${curdir}/../lib/common.inc" testSourceballs() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done @@ -38,14 +37,13 @@ testAnySourceballs() { } testSplitSourceballs() { - local arches=('i686' 'x86_64') local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done @@ -59,20 +57,19 @@ testSplitSourceballs() { } testSourceballsCleanup() { - local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch for pkgbase in "${pkgs[@]}"; do - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do releasePackage extra "${pkgbase}" "${arch}" done done ../db-update ../cron-jobs/sourceballs - for arch in "${arches[@]}"; do + for arch in "${ARCH_BUILD[@]}"; do ../db-remove extra "${arch}" pkg-simple-a done -- cgit v1.2.3-2-g168b From 8700e09c4d2ff0a20d5fa3789a6309078bc1ccb6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 17 Apr 2016 12:18:02 -0400 Subject: Use `grep &>/dev/null` instead of `grep -q` when operating on piped stdin. `grep -q` may exit as soon as it finds a match; this is a good optimization for when the input is a file. However, if the input is the output of another program, then that other program will receive SIGPIPE, and further writes will fail. When this happens, it might (bsdtar does) print a message about a "write error" to stderr. Which is going to confuse and alarm the user. I'll add that this is not purely hypothetical--it has happened to me while running the test suite. --- test/lib/common.inc | 8 ++++---- test/test.d/create-filelists.sh | 10 +++++----- test/test.d/db-update.sh | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/lib/common.inc b/test/lib/common.inc index 5b06616..83c54bd 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -177,7 +177,7 @@ checkAnyPackageDB() { 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 "${pkg}" &>/dev/null) \ || fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}" done done @@ -221,7 +221,7 @@ checkPackageDB() { 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 "${pkg}" &>/dev/null) \ || fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}" done } @@ -247,7 +247,7 @@ checkRemovedPackageDB() { 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 "${pkgbase}" &>/dev/null) \ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}" done } @@ -273,7 +273,7 @@ checkRemovedAnyPackageDB() { for db in "${DBEXT}" "${FILESEXT}"; do for arch in "${ARCH_BUILD[@]}"; 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 "${pkgbase}" &>/dev/null) \ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}" done done diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index e16a8d1..be66fc2 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -17,7 +17,7 @@ testCreateSimpleFileLists() { for pkgbase in "${pkgs[@]}"; do for arch in "${ARCH_BUILD[@]}"; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgbase}"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgbase}" &>/dev/null; then fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}" fi done @@ -36,7 +36,7 @@ testCreateAnyFileLists() { for pkgbase in "${pkgs[@]}"; do for arch in "${ARCH_BUILD[@]}"; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/share/${pkgbase}/test"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/share/${pkgbase}/test" &>/dev/null; then fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}" fi done @@ -62,7 +62,7 @@ testCreateSplitFileLists() { pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]})) for pkgname in "${pkgnames[@]}"; do for arch in "${ARCH_BUILD[@]}"; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgname}" &>/dev/null; then fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}" fi done @@ -88,10 +88,10 @@ testCleanupFileLists() { done for arch in "${ARCH_BUILD[@]}"; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-b"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/pkg-simple-b" &>/dev/null; then fail "usr/bin/pkg-simple-b not found in ${arch}/extra${FILESEXT}" fi - if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-a"; then + if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/pkg-simple-a" &>/dev/null; then fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}" fi done diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 48c243d..9e44970 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -132,7 +132,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 "${pkgbase}" &>/dev/null) \ && fail "${pkgbase} should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" done } @@ -154,7 +154,7 @@ testAddIncompleteSplitPackage() { for arch in "${ARCH_BUILD[@]}"; 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 "${pkgbase}" &>/dev/null) \ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" done } -- cgit v1.2.3-2-g168b From a2891a08c0cde48d966b037503c24b0d8f5b5f6d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 17 Apr 2016 02:07:26 -0400 Subject: Add "#!/hint/bash" to the beginning of several files. It is a method of notifying text-editors that a file is in Bash syntax without giving it a propper shebang (which would be confusing, as it would suggest that the file should be executable), as well as working across virtually all text-editors (unlike "-*- Mode: Bash -*-" or whatever). --- test/lib/common.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/lib/common.inc b/test/lib/common.inc index 83c54bd..954868b 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -1,3 +1,4 @@ +#!/hint/bash set -E . "$(dirname "${BASH_SOURCE[0]}")/../../config" -- cgit v1.2.3-2-g168b From e4e5a028843316edf73cae4ac70d9df3cf8e1565 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 17 Jun 2014 23:47:21 -0400 Subject: Consistently use "$(dirname "$(readlink -e "$0")")" This does correct handling of - executing a program by symlink - any weird characters in the full path - I'm sure there's another case I thought about when I originally did this. --- test/test.d/create-filelists.sh | 2 +- test/test.d/db-move.sh | 2 +- test/test.d/db-remove.sh | 2 +- test/test.d/db-repo-add.sh | 2 +- test/test.d/db-repo-remove.sh | 2 +- test/test.d/db-update.sh | 2 +- test/test.d/ftpdir-cleanup.sh | 2 +- test/test.d/packages.sh | 2 +- test/test.d/signed-packages.sh | 2 +- test/test.d/sourceballs.sh | 2 +- test/test.d/testing2x.sh | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index be66fc2..20dafc6 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testCreateSimpleFileLists() { diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh index 410e222..4b4120e 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testMoveSimplePackages() { diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh index 4fd5548..a391197 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testRemovePackages() { diff --git a/test/test.d/db-repo-add.sh b/test/test.d/db-repo-add.sh index 776c0a2..266a696 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testAddSimplePackages() { diff --git a/test/test.d/db-repo-remove.sh b/test/test.d/db-repo-remove.sh index fd69fa7..727188d 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testRemovePackages() { diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 9e44970..540eccf 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testAddSimplePackages() { diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index 6902b9b..5a7afea 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testCleanupSimplePackages() { diff --git a/test/test.d/packages.sh b/test/test.d/packages.sh index 1a31a41..18266eb 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testPackages() { diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh index 4eccb41..3ffe146 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testAddSignedPackage() { diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh index 561169e..81c9265 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testSourceballs() { diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index 3bbd353..c611ce4 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="$(dirname "$(readlink -e "$0")")" . "${curdir}/../lib/common.inc" testTesting2xAnyPackage() { -- cgit v1.2.3-2-g168b From 9705ba8a148d03dfd4c2184f3a1f13ee373eb826 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 17 Apr 2016 12:08:55 -0400 Subject: Use the librelib version of get_full_version --- test/lib/common.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/lib/common.inc b/test/lib/common.inc index 954868b..bef8749 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -35,7 +35,7 @@ oneTimeSetUp() { pushd "$d" >/dev/null pkgname=($(. PKGBUILD; echo "${pkgname[@]}")) pkgarch=($(. PKGBUILD; echo "${arch[@]}")) - pkgversion=$(. PKGBUILD; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") + pkgversion=$(. PKGBUILD; get_full_version) build=true for a in "${pkgarch[@]}"; do @@ -140,7 +140,7 @@ releasePackage() { 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}") + pkgver=$(. PKGBUILD; get_full_version) pkgname=($(. PKGBUILD; echo "${pkgname[@]}")) popd >/dev/null cp "${pkgdir}/${pkgbase}"/*-"${pkgver}-${arch}"${PKGEXT} "${STAGING}/${repo}/" -- cgit v1.2.3-2-g168b