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-check23
1 files changed, 12 insertions, 11 deletions
diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check
index f5f80c8..105bac4 100755
--- a/cron-jobs/repo-sanity-check
+++ b/cron-jobs/repo-sanity-check
@@ -10,9 +10,9 @@ for _repo in "${PKGREPOS[@]}"; do
# Find all pkgnames on this repo's abs
on_abs=($(
- find ${SVNREPO}/${_repo} -name PKGBUILD | \
+ find "${SVNREPO}/${_repo}" -name PKGBUILD | \
while read pkgbuild; do
- source ${pkgbuild} >/dev/null 2>&1
+ 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 \
@@ -20,11 +20,11 @@ for _repo in "${PKGREPOS[@]}"; do
# also cleanup package functions
for _pkg in "${pkgname[@]}"; do
- unset package_${pkg} >/dev/null 2>&1
+ unset "package_${pkg}" >/dev/null 2>&1
done
# this fills the on_abs array
- echo ${pkgname[@]}
+ echo "${pkgname[@]}"
done
))
@@ -36,20 +36,21 @@ for _repo in "${PKGREPOS[@]}"; do
# Find all pkgnames on repos
on_repo=($(
- find ${FTP_BASE}/${_repo} -name "*.pkg.tar.?z" -printf "%f\n" | \
- sed "s/^\(.\+\)-[^-]\+-[^-]\+-[^-]\+$/\1/"
+ 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=($(comm -13 \
+ <(printf '%s\n' "${on_abs[@]}" | sort -u) \
+ <(printf '%s\n' "${on_repo[@]}" | 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 \;
+ 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")"
+ plain '%s' "${remove[@]}"
done