]> err.no Git - dak/commitdiff
Use a more modular way
authorJoerg Jaspert <joerg@debian.org>
Sat, 18 Sep 2010 20:34:22 +0000 (22:34 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sat, 18 Sep 2010 20:34:22 +0000 (22:34 +0200)
Signed-off-by: Joerg Jaspert <joerg@debian.org>
scripts/debian/import_dataset.sh [moved from scripts/debian/import_testing.sh with 53% similarity]

similarity index 53%
rename from scripts/debian/import_testing.sh
rename to scripts/debian/import_dataset.sh
index 7ee29eabca8c7ea0cafc13c64683a0d340e88ae1..6a8f1292fbf5ac29806c1e4eaceb9dc01f53c36b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright (C) 2008 Joerg Jaspert <joerg@debian.org>
+# Copyright (C) 2008,2010 Joerg Jaspert <joerg@debian.org>
 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
 
 
 set -e
+set -u
 
 # Load up some standard variables
 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
 . $SCRIPTVARS
 
-# What file we look at.
-TESTINGINPUT="/srv/release.debian.org/britney/Heidi/set/current"
+IMPORTSUITE=${1:-"testing"}
+BRITNEY=""
+
+case "${IMPORTSUITE}" in
+    testing)
+        # What file we look at.
+        INPUTFILE="/srv/release.debian.org/britney/Heidi/set/current"
+        DO_CHANGELOG="true"
+        ;;
+    squeeze-volatile)
+        # What file we look at.
+        INPUTFILE="/srv/release.debian.org/volatile/set/squeeze-volatile"
+        DO_CHANGELOG="false"
+        ;;
+    *)
+        echo "You are so wrong here that I can't even believe it. Sod off."
+        exit 42
+        ;;
+esac
 
 # Change to a known safe location
 cd $masterdir
 
-echo "Importing new data for testing into projectb"
+echo "Importing new data for ${INPUTSUITE} into database"
+
+if [ "x${DO_CHANGELOG}x" = "xtruex" ]; then
+    rm ${ftpdir}/dists/${IMPORTSUITE}/ChangeLog
+    BRITNEY=" --britney"
+fi
+
+cat ${INPUTFILE} | dak control-suite --set ${INPUTSUITE} ${BRITNEY}
 
-# Now load the data
-rm ${ftpdir}/dists/testing/ChangeLog
-cat ${TESTINGINPUT} | dak control-suite --set testing --britney
-NOW=$(date "+%Y%m%d%H%M")
-cd ${ftpdir}/dists/testing/
-mv ChangeLog ChangeLog.${NOW}
-ln -s ChangeLog.${NOW} ChangeLog
-find . -maxdepth 1 -mindepth 1 -type f -mmin +2880 -name 'ChangeLog.*' -print0 | xargs --no-run-if-empty -0 rm
+if [ "x${DO_CHANGELOG}x" = "xtruex" ]; then
+    NOW=$(date "+%Y%m%d%H%M")
+    cd ${ftpdir}/dists/${IMPORTSUITE}/
+    mv ChangeLog ChangeLog.${NOW}
+    ln -s ChangeLog.${NOW} ChangeLog
+    find . -maxdepth 1 -mindepth 1 -type f -mmin +2880 -name 'ChangeLog.*' -delete
+fi
 
 echo "Done"