summaryrefslogtreecommitdiff
path: root/cron-jobs/repo-sanity-check
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-08-13 09:01:52 -0700
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-08-13 09:01:52 -0700
commit06573a04a476726687485ba70447ffa71f6840a8 (patch)
treec27755ec564a16d37c106ec55655a18b9d009c86 /cron-jobs/repo-sanity-check
parent4060e42a9f0ff3cea719b1ddcc8abf0289f25f6b (diff)
parentf23d7103fec259ebe2ba796ae7f351dfbda5b705 (diff)
Merge branch 'master' of http://projects.parabolagnulinux.org/dbscripts into stable
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