From 0db47ee6e35fcd1d29d2fe692d402618ba92032b Mon Sep 17 00:00:00 2001 From: lars Date: Fri, 29 Dec 2006 15:35:05 +0000 Subject: [PATCH] leere downloads werden automatisch geloescht Downloads, deren Verifikation fehlschlaegt, werden automatisch geloescht tidy laesst sich per Hand als Syntax-Pruefung einschalten --- documents/Makefile | 7 ++++++- downloads/get_files.sh | 21 ++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/documents/Makefile b/documents/Makefile index 858f3be..09920ef 100644 --- a/documents/Makefile +++ b/documents/Makefile @@ -1,5 +1,10 @@ # validation program VALIDATE_BIN := validate +VALIDATE_OPTS := +# alternativ kann auch ein anderes Pruef-Programm verwendet werden - tidy kann +# aber wohl nicht daran gehindert werden, unwichtige Nachrichten auszugeben +#VALIDATE_BIN := tidy +#VALIDATE_OPTS := -o /dev/null -errors -quiet # our self written documents LYX_FILES := $(shell find . -name *.lyx -type f) # the tex output of lyx @@ -43,7 +48,7 @@ validate: $(EXPORT_DIRS) echo >&2 ;\ false ;\ fi - @$(VALIDATE_BIN) $(shell find . -name *.html -type f) + @$(VALIDATE_BIN) $(VALIDATE_OPTS) $(shell find . -name *.html -type f) ;\ # copy the created files to the destination directory (usually outside of this directory tree) diff --git a/downloads/get_files.sh b/downloads/get_files.sh index 843d33c..6af75e0 100755 --- a/downloads/get_files.sh +++ b/downloads/get_files.sh @@ -12,7 +12,11 @@ KEY_SERVERS="x-hkp://pgp.mit.edu --keyserver hkp://subkeys.pgp.net" function download_file() { local QUELLE=$(grep "^$1[[:space:]]" $URL_FILE | cut -f 2) - wget --continue --output-document "$DEST_DIR/$1" "$QUELLE" + local ZIEL=$DEST_DIR/$1 + # leider sind die exitcodes von wget derzeit noch nicht zuverlaessig (< v1.11) + wget --continue --output-document "$ZIEL" "$QUELLE" + # loesche die Datei, falls sie existiert jedoch leer ist + test -e "$ZIEL" -a ! -s "$ZIEL" && rm "$ZIEL" } function verify_file() @@ -31,11 +35,18 @@ function verify_file() [ ! -e "$SIG_FILE" ] && wget --output-document "$SIG_FILE" "$SIG_URL" # pruefen - notfalls den Schluessel importieren # erstmal Ausgabe unterdruecken - if gpg --quiet --keyserver $KEY_SERVERS --keyserver-options auto-key-retrieve --verify "$SIG_FILE" "$DEST_DIR/$1" &>/dev/null + if gpg --quiet --keyserver $KEY_SERVERS --keyserver-options auto-key-retrieve \ + --verify "$SIG_FILE" "$DEST_DIR/$1" &>/dev/null then return 0 - else gpg --quiet --keyserver $KEY_SERVERS --keyserver-options auto-key-retrieve --verify "$SIG_FILE" "$DEST_DIR/$1" - # do it again (with output), if verification failed - return 1 + else # nochmal - diesmal mit Fehlerausgabe + gpg --quiet --keyserver $KEY_SERVERS --keyserver-options auto-key-retrieve \ + --verify "$SIG_FILE" "$DEST_DIR/$1" + # loesche die heruntergeladene Datei und die Signatur falls die + # Verifikation fehlschlaegt + rm "$DEST_DIR/$1" "$SIG_FILE" + echo "Die heruntergeladene Datei und die Signatur-Datei wurden geloescht." + echo "Versuche es nochmal ..." + return 1 fi }