summaryrefslogtreecommitdiff
path: root/cron-jobs/ftpdir-cleanup
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-08-08 01:26:52 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-08-08 01:26:52 +0200
commit3e08da59e3ca3849b753318b791aed8f1f8d8fb4 (patch)
treeca1469bb5f843cb5a8f7e13e5f056bde611d8ea5 /cron-jobs/ftpdir-cleanup
parent1db7071b222207d2d924a03a48d0745387f11c7b (diff)
fix cleaning of any packages and ignore empty repos
Diffstat (limited to 'cron-jobs/ftpdir-cleanup')
-rwxr-xr-xcron-jobs/ftpdir-cleanup5
1 files changed, 3 insertions, 2 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 66733f0..546afd9 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -37,9 +37,9 @@ for repo in $repos; do
done
to_cleanup=""
-for _arch in ${ARCHES[@]}; do
+for _arch in any ${ARCHES[@]}; do
poolpath="$FTP_BASE/$(get_pkgpool_for_host)/$_arch/"
- cd $poolpath
+ pushd $poolpath >/dev/null
for pkg in *$PKGEXT; do
[ -f "$pkg" ] || continue # in case we get a file named "*.pkg.tar.gz"
LINKS="$(/usr/bin/find $repopaths -type l -name "$pkg" 2>/dev/null)"
@@ -47,6 +47,7 @@ for _arch in ${ARCHES[@]}; do
to_cleanup="$to_cleanup $poolpath/$pkg"
fi
done
+ popd >/dev/null
done
if [ -n "$to_cleanup" ]; then