Make release_team_removals.sh take input from stdin
authorJulien Cristau <jcristau@debian.org>
Thu, 26 May 2016 13:19:58 +0000 (15:19 +0200)
committerJulien Cristau <jcristau@debian.org>
Thu, 26 May 2016 13:19:58 +0000 (15:19 +0200)
Similarly to import_dataset, relying on a shared filesystem prevents us
from moving release.d.o elsewhere.

Signed-off-by: Julien Cristau <jcristau@debian.org>
scripts/debian/release_team_removals.sh

index 82e4e72..3e06755 100755 (executable)
@@ -30,26 +30,23 @@ set -u
 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
 . $SCRIPTVARS
 
-SUITE="testing-proposed-updates"
-IMPORTDIR="/srv/release.debian.org/sets/tpu-removals"
-IMPORTFILE="${IMPORTDIR}/current"
+tempfile=$(mktemp)
+trap "rm -f ${tempfile}" EXIT
 
-if [ ! -e "${IMPORTFILE}" ]; then
-    echo "${IMPORTFILE} not found"
+cat > ${tempfile}
+expected_checksum="${SSH_ORIGINAL_COMMAND}"
+if ! echo "${expected_checksum} ${tempfile}" | md5sum --check --quiet; then
     exit 1
 fi
 
 # Change to a known safe location
 cd $masterdir
 
-echo "Performing cleanup on ${SUITE}"
+SUITE="testing-proposed-updates"
 
-dak control-suite --remove ${SUITE} < ${IMPORTFILE}
+echo "Performing cleanup on ${SUITE}"
 
-if [ $? -eq 0 ]; then
-    NOW=$(date "+%Y%m%d%H%M")
-    mv "${IMPORTFILE}" "${IMPORTDIR}/processed.${NOW}"
-fi
+dak control-suite --remove ${SUITE} < ${tempfile}
 
 echo "Done"