Bug#804905: pbuilder: pdebuild --auto-debsign not working for source only builds

2015-11-12 Thread Mattia Rizzolo
control: user pbuil...@packages.debian.org
control: usertag -1 + pdebuild
control: tags -1 + pending

On Thu, Nov 12, 2015 at 06:44:15PM +, Marcin Kulisz (kuLa) wrote:
> when running 'gbp buildpackage -S' no *${architecture}.changes file is 
> created,
> instead *source.changes is created.
> pdebuild can't find file to sign, thus throwing an error:
> "debsign: Can't find or can't read changes file "
> 
> Attached patch is crude but is solving this problem.

the attached patch is too crude indeed :)
not too far from what I'd like to see, though.

I just committed something based on it, see
the commit 311c138dc394e6771517f339f234afff80ab54f6

maybe you can confirmed it works as expected (haven't tested it, tbh)

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  http://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#804905: pbuilder: pdebuild --auto-debsign not working for source only builds

2015-11-12 Thread Marcin Kulisz (kuLa)
Package: pbuilder
Version: 0.220
Severity: normal
Tags: patch

Hi,

when running 'gbp buildpackage -S' no *${architecture}.changes file is created,
instead *source.changes is created.
pdebuild can't find file to sign, thus throwing an error:
"debsign: Can't find or can't read changes file "

Attached patch is crude but is solving this problem.


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing'), (100, 'unstable'), (10, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pbuilder depends on:
ii  debconf [debconf-2.0]  1.5.57
ii  debootstrap1.0.74
ii  dpkg-dev   1.18.3
ii  wget   1.16.3-3

Versions of packages pbuilder recommends:
ii  devscripts  2.15.9
ii  fakeroot1.20.2-1
ii  iproute24.1.1-1
ii  net-tools   1.60+git20150829.73cef8a-1
ii  sudo1.8.12-1

Versions of packages pbuilder suggests:
ii  cowdancer 0.75

-- debconf information excluded
>From 50281d23fd06f57aafe30d15c638a94da52c4c80 Mon Sep 17 00:00:00 2001
From: Marcin Kulisz 
Date: Thu, 12 Nov 2015 18:18:22 +
Subject: [PATCH] Making pdebuild to sign *source.changes file if +

build is for source only upload
---
 pdebuild | 4 
 1 file changed, 4 insertions(+)

diff --git a/pdebuild b/pdebuild
index 8a28aba..db6709a 100644
--- a/pdebuild
+++ b/pdebuild
@@ -33,6 +33,7 @@ PKG_SOURCENAME=$(dpkg-parsechangelog|sed -n 's/^Source: //p')
 PKG_VERSION=$(dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p')
 ARCHITECTURE="${ARCHITECTURE:-$(dpkg-architecture -qDEB_HOST_ARCH)}"
 CHANGES="${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.changes"
+SOURCE_CHANGES="${PKG_SOURCENAME}_${PKG_VERSION}_source.changes"
 
 if [ -z "${PBUILDER_BUILD_LOGFILE}" ]; then
 PBUILDER_BUILD_LOGFILE="../${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.build"
@@ -96,5 +97,8 @@ if [ "${AUTO_DEBSIGN}" = "yes" ]; then
 	DEBSIGN_PARAM[1]="-k${DEBSIGN_KEYID}"
 fi
 DEBSIGN_PARAM[2]="${BUILDRESULT}/${CHANGES}"
+if [ ! -f "${DEBSIGN_PARAM[2]}" ]; then
+DEBSIGN_PARAM[2]="${BUILDRESULT}/${SOURCE_CHANGES}"
+fi
 debsign "${DEBSIGN_PARAM[@]}"
 fi
-- 
2.6.2