summaryrefslogtreecommitdiff
path: root/cron-jobs/ftpdir-cleanup
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-04-17 19:11:28 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-04-17 19:11:28 -0400
commitacaa58d1833510973cf41fa8349fd3be39c596d8 (patch)
tree2349bb05e74810a475e3b7fba7ce4b0c1b3ef63f /cron-jobs/ftpdir-cleanup
parent0d7d26fb58525411847795e65ce4ce6260349732 (diff)
Backport changes from the lukeshu/xbs branch.
Notable, remove the files.db stuff that became extraneous with pacman 5.
Diffstat (limited to 'cron-jobs/ftpdir-cleanup')
-rwxr-xr-xcron-jobs/ftpdir-cleanup10
1 files changed, 9 insertions, 1 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 4a2b418..4063c09 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -22,6 +22,14 @@ clean_pkg() {
fi
}
+script_lock
+
+for repo in "${PKGREPOS[@]}"; do
+ for arch in "${ARCHES[@]}"; do
+ repo_lock "${repo}" "${arch}" || exit 1
+ done
+done
+
"${CLEANUP_DRYRUN}" && warning 'dry run mode is active'
for repo in "${PKGREPOS[@]}"; do
@@ -56,7 +64,7 @@ done
# get a list of all available packages in the pacakge pool
find "$FTP_BASE/${PKGPOOL}" -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/pool"
# create a list of packages in our db
-cat "${WORKDIR}/db-"* | sort -u > "${WORKDIR}/db"
+find "${WORKDIR}" -maxdepth 1 -type f -name 'db-*' -exec cat {} \; | sort -u > "${WORKDIR}/db"
old_pkgs=($(comm -23 "${WORKDIR}/pool" "${WORKDIR}/db"))
if [ ${#old_pkgs[@]} -ge 1 ]; then