[devscripts] 01/02: debrsign: apply patch from pini to add support for .buildinfo files.

Mattia Rizzolo mattia at debian.org
Sun Oct 8 12:58:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository devscripts.

commit 5a842eb27a2ccb46a04db95056c5c4c495ebf8dc
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sun Oct 8 14:56:43 2017 +0200

    debrsign: apply patch from pini to add support for .buildinfo files.
    
    Closes: #862324
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 debian/changelog    |  3 +++
 scripts/debrsign.sh | 42 ++++++++++++++++++++++++++++--------------
 2 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index beccaec..69bdd5a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -41,6 +41,9 @@ devscripts (2.17.11) UNRELEASED; urgency=medium
       not jessie-backports.  Closes: #877877
   * debian/control:
     + Annotate the build-dependencies on perl and python3-all with :any.
+  * debrsign:
+    + Apply patch from Gilles Filippini <pini at debian.org> to add support for
+      .buildinfo files.  Closes: #862324
 
  -- Chris Lamb <lamby at debian.org>  Wed, 27 Sep 2017 13:24:39 +0100
 
diff --git a/scripts/debrsign.sh b/scripts/debrsign.sh
index 0c7917b..52e2be9 100755
--- a/scripts/debrsign.sh
+++ b/scripts/debrsign.sh
@@ -133,6 +133,8 @@ case $# in
 		changes=$2
 		dsc=`echo $changes | \
 		    perl -pe 's/\.changes$/.dsc/; s/(.*)_(.*)_(.*)\.dsc/\1_\2.dsc/'`
+		buildinfo=`echo $changes | \
+		    perl -pe 's/\.changes$/.buildinfo/; s/(.*)_(.*)_(.*)\.buildinfo/\1_\2_\3.buildinfo/'`
 		;;
 	    *)	echo "$PROGNAME: Only a .changes or .dsc file is allowed as second argument!" >&2
 		exit 1 ;;
@@ -177,6 +179,7 @@ case $# in
 	pv="${package}_${sversion}"
 	pva="${package}_${sversion}${arch:+_${arch}}"
 	dsc="../$pv.dsc"
+	buildinfo="../$pva.buildinfo"
 	changes="../$pva.changes"
 	if [ -n "$multiarch" -o ! -r $changes ]; then
 	    changes=$(ls "../${package}_${sversion}_*+*.changes" "../${package}_${sversion}_multi.changes" 2>/dev/null | head -1)
@@ -207,8 +210,10 @@ then
         exit 1
 fi
 
-changesbase=`basename "$changes"`
-dscbase=`basename "$dsc"`
+declare -A base
+base["$changes"]=`basename "$changes"`
+base["$dsc"]=`basename "$dsc"`
+base["$buildinfo"]=`basename "$buildinfo"`
 
 if [ -n "$changes" ]
 then
@@ -219,26 +224,35 @@ then
     fi
 
     # Is there a dsc file listed in the changes file?
-    if grep -q "$dscbase" "$changes"
+    if grep -q "${base[$dsc]}" "$changes"
     then
 	if [ ! -f "$dsc" -o ! -r "$dsc" ]
 	then
 	    echo "Can't find or can't read dsc file $dsc!" >&2
 	    exit 1
 	fi
-
-	# Now do the real work
-	withecho scp "$changes" "$dsc" "$remotehost:\$HOME"
-	withecho ssh -t "$remotehost" "debsign $signargs $changesbase"
-	withecho scp "$remotehost:\$HOME/$changesbase" "$changes"
-	withecho scp "$remotehost:\$HOME/$dscbase" "$dsc"
-	withecho ssh "$remotehost" "rm -f $changesbase $dscbase"
     else
-	withecho scp "$changes" "$remotehost:\$HOME"
-	withecho ssh -t "$remotehost" "debsign $signargs $changesbase"
-	withecho scp "$remotehost:\$HOME/$changesbase" "$changes"
-	withecho ssh "$remotehost" "rm -f $changesbase"
+        unset base["$dsc"]
+    fi
+    # Is there a buildinfo file listed in the changes file?
+    if grep -q "${base[$buildinfo]}" "$changes"
+    then
+	if [ ! -f "$buildinfo" -o ! -r "$buildinfo" ]
+	then
+	    echo "Can't find or can't read buildinfo file $buildinfo!" >&2
+	    exit 1
+	fi
+    else
+        unset base["$buildinfo"]
     fi
+    # Now do the real work
+    withecho scp "${!base[@]}" "$remotehost:\$HOME"
+    withecho ssh -t "$remotehost" "debsign $signargs ${base[$changes]}"
+    for file in "${!base[@]}"
+    do
+	withecho scp "$remotehost:\$HOME/${base["$file"]}" "$file"
+    done
+    withecho ssh "$remotehost" "rm -f ${base[@]}"
 
     echo "Successfully signed changes file"
 else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list