# HG changeset patch # User krauss # Date 1342384291 -7200 # Node ID 387ed2f309180b0b35a86795bd6659b986fed2fa # Parent 1635298d8fe7198c41a891b7b78a091c08547914 added component integrity checks and some initial checksums diff -r 1635298d8fe7 -r 387ed2f30918 Admin/component_repository/checksum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/component_repository/checksum Sun Jul 15 22:31:31 2012 +0200 @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +# +# Author: Alexander Krauss +# +# Computes and validates checksums for the Isabelle component repository + +THIS="$(cd $(dirname "$0"); pwd)" + +function usage() +{ + echo + echo "Usage: $0 [OPTIONS] [DIR]" + echo + echo " Options are:" + echo " -u update the recorded checksums in the repository" + echo " -c compare the actual checksums with the recorded ones" + echo + echo " Compute the checksums of components in DIR (default '/home/isabelle/components')" + echo " and synchronize them with the Isabelle repository." + echo + exit 1 +} + +function fail() +{ + echo "$1" >&2 + exit 2 +} + + +## process command line + +# options + +UPDATE="" +CHECK="" +COMPONENTS_DIR="/home/isabelle/components" + +while getopts "uc" OPT +do + case "$OPT" in + u) + UPDATE=true + ;; + c) + CHECK=true + ;; + esac +done + +shift $(($OPTIND - 1)) + +[ -n "$UPDATE" ] || [ -n "$CHECK" ] || usage + +# args + +[ "$#" -ge 1 ] && { COMPONENTS_DIR="$1"; shift; } +[ "$#" -ne 0 ] && usage + + +## compute checksums + +CHECKSUM_FILE="$THIS/components.sha1" +CHECKSUM_TMP="$THIS/components.sha1.tmp" + +cd "$COMPONENTS_DIR" +sha1sum *.tar.gz > "$CHECKSUM_TMP" + +[ -n "$UPDATE" ] && mv "$CHECKSUM_TMP" "$CHECKSUM_FILE" +[ -n "$CHECK" ] && (diff "$CHECKSUM_FILE" "$CHECKSUM_TMP" || fail "Integrity error") diff -r 1635298d8fe7 -r 387ed2f30918 Admin/component_repository/components.sha1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/component_repository/components.sha1 Sun Jul 15 22:31:31 2012 +0200 @@ -0,0 +1,10 @@ +2f6417b8e96a0e4e8354fe0f1a253c18fb55d9a7 cvc3-2.4.1.tar.gz +0fe549949a025d65d52d6deca30554de8fca3b6e e-1.5.tar.gz +683acd94761ef460cca1a628f650355370de5afb hol-light-bundle-0.5-126.tar.gz +44775a22f42a9d665696bfb49e53c79371c394b0 jedit_build-20111217.tar.gz +46963db095d6ecdb8c3d174060fdd236971ff6ee jedit_build-20120414.tar.gz +6c737137cc597fc920943783382e928ea79e3feb kodkodi-1.2.16.tar.gz +43b5afbcad575ab6817d2289756ca22fd2ef43a9 spass-3.8ds.tar.gz +869ea6d8ea35c8ba68d7fcb028f16b2b7064c5fd vampire-1.0.tar.gz +4530a1aa6f4498ee3d78d6000fa71a3f63bd077f yices-1.0.28.tar.gz +d94a716502c8503d63952bcb4d4176fac8b28704 z3-4.0.tar.gz