diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 04:30:54 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 04:30:54 -0300 |
commit | e1f1ba1883d5cd76f0a1de7ce0c39af971bf79bb (patch) | |
tree | e1127c3c864a91c841cdf05f57d3f35d482bde6a /extra/coadde/cron-jobs/repo-sanity-check | |
parent | 92ba839ae1ad4d3468fc5ffeeb1d0d184bb4e106 (diff) |
remove duplicated files
Diffstat (limited to 'extra/coadde/cron-jobs/repo-sanity-check')
-rwxr-xr-x | extra/coadde/cron-jobs/repo-sanity-check | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/extra/coadde/cron-jobs/repo-sanity-check b/extra/coadde/cron-jobs/repo-sanity-check deleted file mode 100755 index 239f042..0000000 --- a/extra/coadde/cron-jobs/repo-sanity-check +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# Solves issue165... on the old roundup install. From the database -# backups, the title was "Older/deprecated packages never leave the -# repo", I don't know how the body of the issue is stored in the DB, -# but the title says enough, I think. - -. "$(dirname "$(readlink -e "$0")")/../config" -. "$(dirname "$(readlink -e "$0")")/../db-functions" - -# Traverse all repos -for _repo in "${PKGREPOS[@]}"; do - msg "Cleaning up [%s]" "${_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 "[%s]'s ABS tree is empty, skipping" "${_repo}" - 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 \ - <(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 - - msg2 "Removed the following packages:" - plain '%s' "${remove[@]}" -done |