diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-18 11:58:02 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-18 11:58:02 +0200 |
commit | 8647de4f52e05eadc0a4832813e9a57c20a487dd (patch) | |
tree | c17dede608b49756ef7a8fd4396a20a6baac06d0 | |
parent | 17c9dab4b420ca55fd4fb3f277805af148159a4d (diff) | |
download | dbscripts-8647de4f52e05eadc0a4832813e9a57c20a487dd.tar.gz dbscripts-8647de4f52e05eadc0a4832813e9a57c20a487dd.tar.xz |
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
-rwxr-xr-x | misc-scripts/ftpdir-cleanup-repo | 2 | ||||
-rwxr-xr-x | test/runTest | 43 |
2 files changed, 44 insertions, 1 deletions
diff --git a/misc-scripts/ftpdir-cleanup-repo b/misc-scripts/ftpdir-cleanup-repo index 20f297b..bfc971e 100755 --- a/misc-scripts/ftpdir-cleanup-repo +++ b/misc-scripts/ftpdir-cleanup-repo @@ -63,7 +63,7 @@ for arch in ${ARCHES[@]}; do cd "$ftppath" for pkg in $CLEANUP_TMPDIR/*; do - [ -f "${pkg}" ] || continue + [ ! -d "${pkg}" ] && continue filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1) if [ ! -e "${filename}" ]; then 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" |