From 7d6595c750903114740c7ab726cd89cb73d6c3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Fri, 12 Aug 2011 02:37:50 -0300 Subject: Fixed unexistent REPOS array and skip removal when the ABS tree is empty. --- cron-jobs/repo-sanity-check | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check index 690a9f8..92b26ae 100755 --- a/cron-jobs/repo-sanity-check +++ b/cron-jobs/repo-sanity-check @@ -5,7 +5,7 @@ . "$(dirname $0)/../config" # Traverse all repos -for _repo in ${REPOS[@]}; do +for _repo in ${PKGREPOS[@]}; do # Find all pkgnames on this repo's abs on_abs=($( @@ -27,6 +27,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" | \ -- cgit v1.2.3 From a032c1fad3e2d57a7a1b7cef65d90ea06a766784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 13 Aug 2011 12:42:42 -0300 Subject: Cleaner sourceballs2 --- cron-jobs/sourceballs2 | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/cron-jobs/sourceballs2 b/cron-jobs/sourceballs2 index b29b396..a43d71e 100755 --- a/cron-jobs/sourceballs2 +++ b/cron-jobs/sourceballs2 @@ -33,24 +33,28 @@ for repo in ${PKGREPOS[@]}; do continue } - unset pkgbase pkgname +# Unset the previous data + unset pkgbase pkgname pkgver pkgrel source PKGBUILD + + unset build package url pkgdesc source md5sums depends makedepends \ + optdepends license arch options check mksource + + for _pkg in ${pkgname[@]}; do + unset package_${_pkg} >/dev/null 2>&1 + done + pkgbase=${pkgbase:-$pkgname} + srcfile="${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" - echo "${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" >> "${WORKDIR}/expected-src-pkgs" + echo "${srcfile}" >> "${WORKDIR}/expected-src-pkgs" # Skip already sourceballed - [[ -e "${SRCPKGDEST}/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" ]] && \ - continue + [ -e "${SRCPKGDEST}/${srcfile}" ] && continue - msg2 "$pkgbase-$pkgver-$pkgrel..." - makepkg --allsource --ignorearch -c makepkg --allsource --ignorearch -c >/dev/null 2>&1 - [[ $? -ne 0 ]] && { - warning "Failed." - failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" - } + [ $? -ne 0 ] && failedpkgs+=("${srcfile}") done popd >/dev/null @@ -89,10 +93,5 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi -msg "Failed" -for _fail in ${failedpkgs[@]}; do - msg2 "$_fail" -done - script_unlock -- cgit v1.2.3 From f23d7103fec259ebe2ba796ae7f351dfbda5b705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 13 Aug 2011 12:51:32 -0300 Subject: Added useful messages --- cron-jobs/repo-sanity-check | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check index 92b26ae..1ba90a6 100755 --- a/cron-jobs/repo-sanity-check +++ b/cron-jobs/repo-sanity-check @@ -6,6 +6,7 @@ # Traverse all repos for _repo in ${PKGREPOS[@]}; do + msg "Cleaning up [${_repo}]" # Find all pkgnames on this repo's abs on_abs=($( @@ -45,7 +46,10 @@ for _repo in ${PKGREPOS[@]}; 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 -- cgit v1.2.3