From 2390f8671de9de6449d21269b112c37b95c3dcbb Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sat, 18 Sep 2010 22:34:22 +0200 Subject: [PATCH] Use a more modular way Signed-off-by: Joerg Jaspert --- .../{import_testing.sh => import_dataset.sh} | 48 ++++++++++++++----- 1 file changed, 36 insertions(+), 12 deletions(-) rename scripts/debian/{import_testing.sh => import_dataset.sh} (53%) diff --git a/scripts/debian/import_testing.sh b/scripts/debian/import_dataset.sh similarity index 53% rename from scripts/debian/import_testing.sh rename to scripts/debian/import_dataset.sh index 7ee29eab..6a8f1292 100755 --- a/scripts/debian/import_testing.sh +++ b/scripts/debian/import_dataset.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (C) 2008 Joerg Jaspert +# Copyright (C) 2008,2010 Joerg Jaspert # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -23,27 +23,51 @@ 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" -- 2.39.2