From: Joerg Jaspert Date: Sat, 18 Sep 2010 20:34:22 +0000 (+0200) Subject: Use a more modular way X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;ds=sidebyside;h=2390f8671de9de6449d21269b112c37b95c3dcbb;hp=-c;p=dak.git Use a more modular way Signed-off-by: Joerg Jaspert --- 2390f8671de9de6449d21269b112c37b95c3dcbb diff --git a/scripts/debian/import_dataset.sh b/scripts/debian/import_dataset.sh new file mode 100755 index 00000000..6a8f1292 --- /dev/null +++ b/scripts/debian/import_dataset.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +set -e +set -u + +# Load up some standard variables +export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars +. $SCRIPTVARS + +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 ${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} + +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" + +exit 0 diff --git a/scripts/debian/import_testing.sh b/scripts/debian/import_testing.sh deleted file mode 100755 index 7ee29eab..00000000 --- a/scripts/debian/import_testing.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2008 Joerg Jaspert - -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -set -e - -# 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" - -# Change to a known safe location -cd $masterdir - -echo "Importing new data for testing into projectb" - -# 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 - -echo "Done" - -exit 0