From: Julien Cristau Date: Wed, 2 Dec 2015 21:11:48 +0000 (+0100) Subject: Pass suite name to the autobyhand scripts X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=878f326ae708fa5c918e5e63c274fe012ac038f8;p=dak.git Pass suite name to the autobyhand scripts To: debian-dak@lists.debian.org Cc: Julien Cristau Date: Wed, 2 Dec 2015 08:01:37 +0100 (14 hours, 9 minutes, 8 seconds ago) Resent-From: debian-dak@lists.debian.org We have it readily available, and most scripts try to get it back from the changes file anyway. This makes things consistent for the scripts, so they won't get confused by aliases (due to codenames or suite mappings) depending on whatever is in the .changes file. Signed-off-by: Julien Cristau Signed-off-by: Joerg Jaspert --- diff --git a/daklib/archive.py b/daklib/archive.py index 7dd1822a..4226ce9c 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -1170,7 +1170,7 @@ class ArchiveUpload(object): continue script = rule['Script'] - retcode = daklib.daksubprocess.call([script, os.path.join(self.directory, f.filename), control['Version'], arch, os.path.join(self.directory, self.changes.filename)], shell=False) + retcode = daklib.daksubprocess.call([script, os.path.join(self.directory, f.filename), control['Version'], arch, os.path.join(self.directory, self.changes.filename), suite.suite_name], shell=False) if retcode != 0: print "W: error processing {0}.".format(f.filename) remaining.append(f) diff --git a/scripts/debian/byhand-debian-faq b/scripts/debian/byhand-debian-faq index b436dc72..e87f02cb 100755 --- a/scripts/debian/byhand-debian-faq +++ b/scripts/debian/byhand-debian-faq @@ -28,8 +28,8 @@ export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars scriptname=byhand-debian-faq -if [ $# -lt 4 ]; then - echo "usage: ${scriptname} " >&2 +if [ $# -lt 5 ]; then + echo "usage: ${scriptname} " >&2 exit 1 fi @@ -38,8 +38,8 @@ byhand_file="${byhand_path##*/}" version="${2}" architecture="${3}" changes="${4}" +suite="${5}" -suite="$(awk '/^Distribution:/ { print $2 }' < "${changes}")" case "${suite}" in unstable|sid) : # okay diff --git a/scripts/debian/byhand-di b/scripts/debian/byhand-di index 783c2b9f..c4a747c2 100755 --- a/scripts/debian/byhand-di +++ b/scripts/debian/byhand-di @@ -4,8 +4,8 @@ set -u set -e set -o pipefail -if [ $# -lt 4 ]; then - echo "Usage: $0 filename version arch changes_file" +if [ $# -lt 5 ]; then + echo "Usage: $0 filename version arch changes_file suite" exit 1 fi @@ -13,6 +13,7 @@ TARBALL="$1" # Tarball to read, compressed with gzip VERSION="$2" ARCH="$3" CHANGES="$4" # Changes file for the upload +SUITE="$5" error() { echo "$*" @@ -26,13 +27,7 @@ if ! echo "$VERSION" | grep -Eq "^[0-9]{8}((\.|\+?[a-z]+|\+deb[0-9]+u|\+kbsd[0-9 error "Invalid version: '$VERSION'" fi -# Get the target suite from the Changes file -# NOTE: it may be better to pass this to the script as a parameter! -SUITE="$(grep "^Distribution:" "$CHANGES" | awk '{print $2}')" case $SUITE in - "") - error "Error: unable to determine suite from Changes file" - ;; unstable|sid|*-proposed-updates) : # nothing to do ;; diff --git a/scripts/debian/byhand-task b/scripts/debian/byhand-task index 1fcccc08..41f863c5 100755 --- a/scripts/debian/byhand-task +++ b/scripts/debian/byhand-task @@ -4,8 +4,8 @@ set -u set -e set -o pipefail -if [ $# -lt 4 ]; then - echo "Usage: $0 filename version arch changes_file" +if [ $# -lt 5 ]; then + echo "Usage: $0 filename version arch changes_file suite" exit 1 fi @@ -16,19 +16,14 @@ INPUT="$1" # Tarball to read, compressed with gzip VERSION="$2" ARCH="$3" CHANGES="$4" # Changes file for the upload +SUITE="$5" error() { echo "$*" exit 1 } -# Get the target suite from the Changes file -# NOTE: it may be better to pass this to the script as a parameter! -SUITE="$(grep "^Distribution:" "$CHANGES" | awk '{print $2}')" case $SUITE in - "") - error "Error: unable to determine suite from Changes file" - ;; unstable|sid) : # OK for automated byband processing ;; diff --git a/scripts/debian/byhand-win32-loader b/scripts/debian/byhand-win32-loader index 3afc8d52..ea4a1f90 100755 --- a/scripts/debian/byhand-win32-loader +++ b/scripts/debian/byhand-win32-loader @@ -3,8 +3,8 @@ set -u set -e -if [ $# -lt 4 ]; then - echo "Usage: $0 filename version arch changes_file" +if [ $# -lt 5 ]; then + echo "Usage: $0 filename version arch changes_file suite" exit 1 fi @@ -16,16 +16,10 @@ WIN32_LOADER_FILE="${WIN32_LOADER_PATH##*/}" VERSION="$2" ARCH="$3" CHANGES="$4" # Changes file for the upload +SUITE="$5" -# Get the target suite from the Changes file -# NOTE: it may be better to pass this to the script as a parameter! -SUITE="$(grep "^Distribution:" "$CHANGES" | awk '{print $2}')" case $SUITE in - "") - echo "Error: unable to determine suite from Changes file" - exit 1 - ;; - unstable|sid) + unstable|sid|*-proposed-updates) : # nothing to do ;; *)