summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-08-18 11:58:02 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-08-18 11:58:02 +0200
commit8647de4f52e05eadc0a4832813e9a57c20a487dd (patch)
treec17dede608b49756ef7a8fd4396a20a6baac06d0 /test
parent17c9dab4b420ca55fd4fb3f277805af148159a4d (diff)
Fix cleanup of old packages
* This should fix the cleanup of packages that were not within the pacakge pool before being updated. * a test case for this was added
Diffstat (limited to 'test')
-rwxr-xr-xtest/runTest43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/runTest b/test/runTest
index 72f9b1c..cfc4ee6 100755
--- a/test/runTest
+++ b/test/runTest
@@ -395,6 +395,42 @@ testMovePackagesWithoutPool() {
done
}
+testUpdateAnyPackageWithoutPool() {
+ local pkgname='pkg-any-a'
+ local pkg1='pkg-any-a-1-1-any.pkg.tar.xz'
+ local pkg2='pkg-any-a-1-2-any.pkg.tar.xz'
+ local arch
+
+
+ releasePackage extra pkg-any-a any
+ ../db-update
+ # transform two packages to old style layout
+ mv -f "${FTP_BASE}/$(get_pkgpool_for_host)/${pkg1}" "${FTP_BASE}/extra/os/any"
+ for arch in i686 x86_64; do
+ ln -sf "../any/${pkg1}" "${FTP_BASE}/extra/os/${arch}"
+ done
+
+ pushd "${TMP}/svn-packages-copy/${pkgname}/trunk/" >/dev/null
+ sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD
+ svn commit -q -m"update pkg to pkgrel=2" >/dev/null
+ makepkg -cf --config ${curdir}/lib/makepkg-i686.conf >/dev/null 2>&1
+ mv "${pkg2}" "${pkgdir}/${pkgname}/"
+ popd >/dev/null
+
+ releasePackage extra ${pkgname} any
+ ../db-update
+ rm "${pkgdir}/${pkgname}/${pkg2}"
+
+ ../cron-jobs/ftpdir-cleanup >/dev/null
+
+ checkAnyPackage extra "${pkg2}"
+
+ [ -f "${FTP_BASE}/$(get_pkgpool_for_host)/${pkg1}" ] && fail "$(get_pkgpool_for_host)/${pkg1} found"
+ for arch in any i686 x86_64; do
+ [ -f "${FTP_BASE}/extra/os/${arch}/${pkg1}" ] && fail "extra/os/${arch}/${pkg1} found"
+ done
+}
+
testMoveAnyPackagesWithoutPool() {
local pkgs=('pkg-any-a' 'pkg-any-b')
local pkgbase
@@ -428,6 +464,13 @@ testMoveAnyPackagesWithoutPool() {
done
checkRemovedAnyPackage testing ${pkgbase}
done
+
+ for pkg in "${pkgdir}/${pkgs[0]}"/*-any.pkg.tar.*; do
+ pkg=$(basename $pkg)
+ for arch in any i686 x86_64; do
+ [ -f "${FTP_BASE}/testing/os/${arch}/${pkg}" ] && fail "testing/os/${arch}/${pkg} found"
+ done
+ done
}
. "${curdir}/lib/shunit2"