Bug#862324: /usr/bin/debrsign: debrsign doesn't copy buildinfo file

2017-10-08 Thread Mattia Rizzolo
On Sun, Oct 08, 2017 at 02:50:52PM +0200, Gilles Filippini wrote:
> > I have a question about your patch: you defined a 'files' variable that
> > doesn't seem to be ever used.  What's that for?
> 
> It's of no use indeed. This is something from previous tries. You can
> safely drop it.

Thanks for confirming!
I've applied your patch after dropping that variable.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#862324: /usr/bin/debrsign: debrsign doesn't copy buildinfo file

2017-10-08 Thread Gilles Filippini
Hi Mattia,

Mattia Rizzolo a écrit le 08/10/2017 à 14:38 :
> 
> Hi Gilles,
> 
> On Sat, Oct 07, 2017 at 08:19:51PM +0200, Gilles Filippini wrote:
>> Patch proposal attached.
> 
> Thank you for your patch!

Thanks for considering it :)

> I have a question about your patch: you defined a 'files' variable that
> doesn't seem to be ever used.  What's that for?

It's of no use indeed. This is something from previous tries. You can
safely drop it.

Thanks,

_g.




signature.asc
Description: OpenPGP digital signature


Bug#862324: /usr/bin/debrsign: debrsign doesn't copy buildinfo file

2017-10-08 Thread Mattia Rizzolo

Hi Gilles,

On Sat, Oct 07, 2017 at 08:19:51PM +0200, Gilles Filippini wrote:
> Patch proposal attached.

Thank you for your patch!

I have a question about your patch: you defined a 'files' variable that
doesn't seem to be ever used.  What's that for?

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#862324: /usr/bin/debrsign: debrsign doesn't copy buildinfo file

2017-10-07 Thread Gilles Filippini
Control: tags -1 + patch

Hi,

On Thu, 11 May 2017 10:50:55 +0200 Rhonda D'Vine  wrote:
> Package: devscripts
> Version: 2.17.5
> Severity: important
> File: /usr/bin/debrsign
> 
> Dear Maintainer,
> 
>  debrsign doesn't support buildinfo files and thus fails to sign
> changes files properly currently.

Patch proposal attached.

Thanks,

_g.
--- a/debrsign	2017-09-14 04:08:30.0 +0200
+++ b/debrsign	2017-10-07 20:11:40.428779172 +0200
@@ -133,6 +133,8 @@
 		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 @@
 	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 @@
 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
@@ -218,27 +223,39 @@
 	exit 1
 fi
 
+files=$changes
 # Is there a dsc file listed in the changes file?
-if grep -q "$dscbase" "$changes"
+if grep -q "${base[$dsc]}" "$changes"
 then
+files="$files $dsc"
 	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
+files="$files $buildinfo"
+	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


signature.asc
Description: OpenPGP digital signature


Bug#862324: /usr/bin/debrsign: debrsign doesn't copy buildinfo file

2017-05-11 Thread Rhonda D'Vine
Package: devscripts
Version: 2.17.5
Severity: important
File: /usr/bin/debrsign

Dear Maintainer,

 debrsign doesn't support buildinfo files and thus fails to sign
changes files properly currently.

 Enjoy,
Rhonda