summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-10-06 09:16:01 -0500
committerZach van Rijn <me@zv.io>2021-10-06 09:16:01 -0500
commitaf52f540a750ec8ef4700711ea87c50f9b385fb1 (patch)
tree66f212dd9ca33163e45114225c325091eb099e71 /scripts
parent1279c813d8c31b6690d67e94e90de2ae9570ff4b (diff)
downloadpackages-af52f540a750ec8ef4700711ea87c50f9b385fb1.tar.gz
packages-af52f540a750ec8ef4700711ea87c50f9b385fb1.tar.bz2
packages-af52f540a750ec8ef4700711ea87c50f9b385fb1.tar.xz
packages-af52f540a750ec8ef4700711ea87c50f9b385fb1.zip
scripts/healthchecks: make failure records persistent
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/healthchecks17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/healthchecks b/scripts/healthchecks
index f50a9a3dd..9742ec3fd 100755
--- a/scripts/healthchecks
+++ b/scripts/healthchecks
@@ -23,8 +23,8 @@
# Configurable paths.
#
HERE="$(dirname $(readlink -f ${0}))";
-TEMP="$(mktemp -d)"; # temp dir for further analysis
-SAVE="${HERE}/../cache"; # successful download cache dir
+TEMP="$(mktemp -d)"; # tmp dir for intermediate files
+SAVE="/var/www/source/archive"; # successful download cache dir
##
@@ -62,13 +62,16 @@ try_down ()
##
- # Record any possible failure.
+ # Record any possible failure if new, otherwise delete it.
#
if test ${okay} -ne 0; then
- printf >> "${TEMP}/fail.list" "%s %s %s\n" \
+ grep 1>/dev/null "${name}" "${SAVE}/_savefail.txt" && return;
+ printf >> "${SAVE}/_savefail.txt" "%s\t%s %s\n" \
"${okay}" "${name}" "${down}" \
;
return;
+ else
+ sed -i "${SAVE}/_savefail.txt" -e "/\b${name}\b/d";
fi
@@ -122,7 +125,7 @@ gen_sums ()
# main loop
mkdir -p "${SAVE}";
-touch "${TEMP}/fail.list";
+touch "${SAVE}/_savefail.txt";
touch "${SAVE}/SHA512SUMS";
printf "We will now begin processing matching packages:\n";
@@ -209,10 +212,10 @@ done
# analysis
printf "\nThe following source files failed to download:\n\n";
-cat "${TEMP}/fail.list";
+cat "${SAVE}/_savefail.txt";
printf "\nThe following source files exist but mismatch:\n\n";
-uniq -u "${SAVE}/SHA512SUMS";
+uniq -u "${SAVE}/SHA512SUMS" | tee "${SAVE}/_hashfail.txt";
#---------------------------------------------------------------