]> git.decadent.org.uk Git - dak.git/commitdiff
Change import_dataset.sh to take its input from stdin
authorJulien Cristau <jcristau@debian.org>
Wed, 25 May 2016 12:25:45 +0000 (14:25 +0200)
committerJulien Cristau <jcristau@debian.org>
Wed, 25 May 2016 12:25:45 +0000 (14:25 +0200)
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 <jcristau@debian.org>
scripts/debian/import_dataset.sh

index 98e120762d6d17384a32db1e4dc936d34bccfecd..6eb39cacda49ec5c1ad7c8bd9f2fd0b860523f3b 100755 (executable)
@@ -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")