summaryrefslogtreecommitdiff
path: root/cron-jobs/repo-sanity-check
diff options
context:
space:
mode:
Diffstat (limited to 'cron-jobs/repo-sanity-check')
-rwxr-xr-xcron-jobs/repo-sanity-check14
1 files changed, 12 insertions, 2 deletions
diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check
index 690a9f8..1ba90a6 100755
--- a/cron-jobs/repo-sanity-check
+++ b/cron-jobs/repo-sanity-check
@@ -5,7 +5,8 @@
. "$(dirname $0)/../config"
# Traverse all repos
-for _repo in ${REPOS[@]}; do
+for _repo in ${PKGREPOS[@]}; do
+ msg "Cleaning up [${_repo}]"
# Find all pkgnames on this repo's abs
on_abs=($(
@@ -27,6 +28,12 @@ for _repo in ${REPOS[@]}; do
done
))
+# quit if abs is empty
+ if [ ${#on_abs[*]} -eq 0 ]; then
+ warning "[${_repo}]'s ABS tree is empty, skipping"
+ break
+ fi
+
# Find all pkgnames on repos
on_repo=($(
find ${FTP_BASE}/${_repo} -name "*.pkg.tar.?z" -printf "%f\n" | \
@@ -39,7 +46,10 @@ for _repo in ${REPOS[@]}; do
# Remove them from databases, ftpdir-cleanup will take care of the rest
find ${FTP_BASE}/${_repo} -name "*.db.tar.?z" -exec \
- repo-remove {} ${remove[@]} \;
+ repo-remove {} ${remove[@]} >/dev/null 2>&1 \;
+
+ msg2 "Removed the following packages:"
+ plain "$(echo ${remove[@]} | tr ' ' "\n")"
done