From 8647de4f52e05eadc0a4832813e9a57c20a487dd Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 18 Aug 2010 11:58:02 +0200 Subject: 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 --- test/runTest | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'test') 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" -- cgit v1.2.3-24-g4f1b