From 336dcafd70ea7f5b9bf4e2f30b6c44faf973c855 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 2 Sep 2007 14:29:12 +0200 Subject: [PATCH] Merge from CVS: Skip clean-up if extraction fails and some minor changes revision 1.3 date: 2007-07-26 15:32:23 +0200; author: djpig; state: Exp; lines: +13 -5 Skip clean-up run if extraction failed so that we don't lose all the changelogs next time some bugs goes unnoticed for a week ---------------------------- revision 1.2 date: 2007-07-23 18:47:49 +0200; author: djpig; state: Exp; lines: +2 -2 Commit some older local changes: * double time until deletion, no reason here to be too strict * enable debug output, makes the logs much more informative in case of problems --- bin/extract_changelogs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bin/extract_changelogs b/bin/extract_changelogs index 08be087..7d6f3e4 100755 --- a/bin/extract_changelogs +++ b/bin/extract_changelogs @@ -26,21 +26,29 @@ fi ( date +successful=1 for part in $parts; do time "${bindir}/extract_files" -v -d "${localdir}/pool/$part/" \ -t "${htmldir}/changelogs/pool/$part/" \ -c "$configdir" -w "$tmpdir" \ --dumpfile "${filesdir}/changelogs.$part.dump" \ - --cachefile "${filesdir}/changelogs.cache" + --cachefile "${filesdir}/changelogs.cache" --debug + if [ $? -ne 0 ]; then + echo program exited with non-zero exitcode: $? >&2 + successful=0 + fi done -find "${htmldir}/changelogs/" -name log -cmin +7200 \ - | while read logfile; do - dir=$(dirname "$logfile") +if [ "$successful" -eq 1 ]; then + find "${htmldir}/changelogs/" -name log -cmin +14440 \ + | while read logfile; do + dir=$(dirname "$logfile") echo deleting $dir rm -r "$dir" rmdir --ignore-fail-on-non-empty $(dirname "$dir") -done - + done +else + echo clean-up skipped because at least one of the extraction runs failed >&2 +fi date ) > $log 2>&1 -- 2.39.2