diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 12:36:33 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 12:36:33 -0400 |
commit | df49c9b89e56b6c8d2d20cdcc9e03dc80996fcdd (patch) | |
tree | 26a710fd24b38a953d662707d46445662ba0a29b /cron-jobs/repo-sanity-check | |
parent | 63381988ae8a0f4e0c8eaede88b43a5f685ec80f (diff) |
use tab indent
Diffstat (limited to 'cron-jobs/repo-sanity-check')
-rwxr-xr-x | cron-jobs/repo-sanity-check | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check index 9d351df..f5f80c8 100755 --- a/cron-jobs/repo-sanity-check +++ b/cron-jobs/repo-sanity-check @@ -6,50 +6,50 @@ # Traverse all repos for _repo in "${PKGREPOS[@]}"; do - msg "Cleaning up [${_repo}]" - -# Find all pkgnames on this repo's abs - on_abs=($( - find ${SVNREPO}/${_repo} -name PKGBUILD | \ - while read pkgbuild; do - source ${pkgbuild} >/dev/null 2>&1 -# cleanup to save memory - unset build package source md5sums pkgdesc pkgver pkgrel epoch \ - url license arch depends makedepends optdepends options \ - >/dev/null 2>&1 - -# also cleanup package functions - for _pkg in "${pkgname[@]}"; do - unset package_${pkg} >/dev/null 2>&1 - done - -# this fills the on_abs array - echo ${pkgname[@]} - 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" | \ - sed "s/^\(.\+\)-[^-]\+-[^-]\+-[^-]\+$/\1/" - )) - -# Compares them, whatever is on repos but not on abs should be removed - remove=($(comm -13 <(echo ${on_abs[@]} | tr ' ' "\n" | sort -u) \ - <(echo ${on_repo[@]} | tr ' ' "\n" | sort -u))) - -# Remove them from databases, ftpdir-cleanup will take care of the rest - find ${FTP_BASE}/${_repo} -name "*.db.tar.?z" -exec \ - repo-remove {} ${remove[@]} >/dev/null 2>&1 \; - - msg2 "Removed the following packages:" - plain "$(echo ${remove[@]} | tr ' ' "\n")" + msg "Cleaning up [${_repo}]" + + # Find all pkgnames on this repo's abs + on_abs=($( + find ${SVNREPO}/${_repo} -name PKGBUILD | \ + while read pkgbuild; do + source ${pkgbuild} >/dev/null 2>&1 + # cleanup to save memory + unset build package source md5sums pkgdesc pkgver pkgrel epoch \ + url license arch depends makedepends optdepends options \ + >/dev/null 2>&1 + + # also cleanup package functions + for _pkg in "${pkgname[@]}"; do + unset package_${pkg} >/dev/null 2>&1 + done + + # this fills the on_abs array + echo ${pkgname[@]} + 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" | \ + sed "s/^\(.\+\)-[^-]\+-[^-]\+-[^-]\+$/\1/" + )) + + # Compares them, whatever is on repos but not on abs should be removed + remove=($(comm -13 <(echo ${on_abs[@]} | tr ' ' "\n" | sort -u) \ + <(echo ${on_repo[@]} | tr ' ' "\n" | sort -u))) + + # Remove them from databases, ftpdir-cleanup will take care of the rest + find ${FTP_BASE}/${_repo} -name "*.db.tar.?z" -exec \ + repo-remove {} ${remove[@]} >/dev/null 2>&1 \; + + msg2 "Removed the following packages:" + plain "$(echo ${remove[@]} | tr ' ' "\n")" done |