diff options
-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" |