summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-11-01 12:11:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-11-01 12:11:50 +0100
commit278d07fb2b72951e1f03154df55bb833cc38d29b (patch)
tree2dcf12dddcb4465402ff3266cd320437a683a09c
parent0b43e8cdee1ee46ea79e4d089136e76e767b4d5b (diff)
downloaddbscripts-278d07fb2b72951e1f03154df55bb833cc38d29b.tar.gz
dbscripts-278d07fb2b72951e1f03154df55bb833cc38d29b.tar.xz
cron-jobs: Fix issues with empty repositories
-rwxr-xr-xcron-jobs/ftpdir-cleanup2
-rwxr-xr-xcron-jobs/sourceballs4
2 files changed, 3 insertions, 3 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 8f5cb3c..2683676 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -64,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
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs
index be66e99..4126c37 100755
--- a/cron-jobs/sourceballs
+++ b/cron-jobs/sourceballs
@@ -117,8 +117,8 @@ for repo in ${PKGREPOS[@]}; do
done
# Cleanup old source packages
-cat "${WORKDIR}/expected-src-pkgs" | sort -u > "${WORKDIR}/expected-src-pkgs.sort"
-cat "${WORKDIR}/available-src-pkgs" | sort -u > "${WORKDIR}/available-src-pkgs.sort"
+find "${WORKDIR}" -maxdepth 1 -type f -name 'expected-src-pkgs' -exec cat {} \; | sort -u > "${WORKDIR}/expected-src-pkgs.sort"
+find "${WORKDIR}" -maxdepth 1 -type f -name 'available-src-pkgs' -exec cat {} \; | sort -u > "${WORKDIR}/available-src-pkgs.sort"
old_pkgs=($(comm -23 "${WORKDIR}/available-src-pkgs.sort" "${WORKDIR}/expected-src-pkgs.sort"))
if [ ${#old_pkgs[@]} -ge 1 ]; then