From: Julien Cristau Date: Wed, 25 May 2016 12:25:45 +0000 (+0200) Subject: Change import_dataset.sh to take its input from stdin X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=430ecbbc12f286d93b91764144b2c8394ef9ee0f;p=dak.git Change import_dataset.sh to take its input from stdin We plan on moving release.debian.org to a separate host, so won't be able to share a filesystem between release and dak. Instead take the dataset from stdin, with a md5sum passed through the command line (via SSH_ORIGINAL_COMMAND). Signed-off-by: Julien Cristau --- diff --git a/scripts/debian/import_dataset.sh b/scripts/debian/import_dataset.sh index 98e12076..6eb39cac 100755 --- a/scripts/debian/import_dataset.sh +++ b/scripts/debian/import_dataset.sh @@ -31,31 +31,16 @@ export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars IMPORTSUITE=${1:-"testing"} BRITNEY="" +MD5SUM="${SSH_ORIGINAL_COMMAND}" case "${IMPORTSUITE}" in testing) - # What file we look at. - INPUTFILE="/srv/release.debian.org/britney/Heidi/set/current" DO_CHANGELOG="true" ;; testing-debug) - # What file we look at. - INPUTFILE="/srv/release.debian.org/sets/testing-debug/current" - DO_CHANGELOG="false" - ;; squeeze-updates) - # What file we look at. - INPUTFILE="/srv/release.debian.org/sets/squeeze-updates/current" - DO_CHANGELOG="false" - ;; wheezy-updates) - # What file we look at. - INPUTFILE="/srv/release.debian.org/sets/wheezy-updates/current" - DO_CHANGELOG="false" - ;; jessie-updates) - # What file we look at. - INPUTFILE="/srv/release.debian.org/sets/jessie-updates/current" DO_CHANGELOG="false" ;; *) @@ -74,7 +59,13 @@ if [ "x${DO_CHANGELOG}x" = "xtruex" ]; then BRITNEY=" --britney" fi -dak control-suite --set ${IMPORTSUITE} ${BRITNEY} < ${INPUTFILE} +tmpfile=$(mktemp) +trap "rm -f ${tmpfile}" EXIT +cat > ${tmpfile} +if ! echo "${MD5SUM} ${tmpfile}" | md5sum -c --quiet; then + exit 42 +fi +dak control-suite --set ${IMPORTSUITE} ${BRITNEY} < ${tmpfile} if [ "x${DO_CHANGELOG}x" = "xtruex" ]; then NOW=$(date "+%Y%m%d%H%M")