validate-script.sh.in 514 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh

set -e

SIGNATURE_FILE={{ signature_file }}
NSIGNATURE_FILE={{ signature_file }}.tmp
SIGNATURE_STATUS={{ signature_file }}.status

touch $SIGNATURE_FILE
{{ sha256sum }} {{ path_list }} | sort -k 66 > $NSIGNATURE_FILE

12
if diff "$SIGNATURE_FILE" "$NSIGNATURE_FILE" > /dev/null; then
13 14 15
  rm -f "$NSIGNATURE_FILE"
else
  mv "$NSIGNATURE_FILE" "$SIGNATURE_FILE"
16 17
  # do not catch errors during validation
  set +e
18 19
  {{ wrapper }} -validate
  echo $? > $SIGNATURE_STATUS
20
  set -e
21 22
fi
exit `cat $SIGNATURE_STATUS`