#1140788 dpkg-buildpackage will fail when sequoia is installed

#1140788#5
Date:
2026-06-26 12:22:00 UTC
From:
To:
Hi,

when sequoia is installed, then building/signing with dpkg-buildpackage
will fail when it was signed before:

$ dpkg-buildpackage -S -d -nc
dpkg-buildpackage: info: source-only, diff-only upload (original source NOT included)
 signfile ansible_2.7.7+dfsg-1+deb10u3.dsc

  Error: File ../ansible_2.7.7+dfsg-1+deb10u3.dsc.asc exists, use "sq --overwrite ..." to overwrite
dpkg-buildpackage: hint: imported own keys might be missing ownership information, try:
dpkg-buildpackage: hint:   sq pki link authorize --cert FINGERPRINT --all --unconstrained
dpkg-buildpackage: error: failed to sign ../ansible_2.7.7+dfsg-1+deb10u3.dsc file: key is not signature-capable

This is different from using gnupg, where it will happily overwrite the
old signature. In this case the hint that dpkg-buildpackage gives is
also wrong, the key has owneship info and is also signature-capable.

I recommend catching also this error condition, and also adding
--overwrite to the sq invocation to match it with gnupg.

Regards,
Lee

#1140788#8
Date:
2026-07-01 01:02:13 UTC
From:
To:
Hi!

Bug #1140788 in package dpkg reported by you has been fixed in
the dpkg/dpkg.git Git repository. You can see the changelog below, and
you can check the diff of the fix at:

https://git.dpkg.org/cgit/dpkg/dpkg.git/diff/?id=eb3b315e2
---
dpkg-buildpackage: Remove temporary *.dsc.asc file before and after signing

To sign the .dsc we use a temporary file that then we move into place,
so that we do not have to care about any overwrite behavior of the
various OpenPGP implementations.

If the build gets stopped during the signing process, or if it fails,
we might end up with lingering .dsc.asc files that some OpenPGP
implementations will refuse to overwrite, causing a confusing error.

Instead add an exit handler to remove the temporary file in case of any
error, and unconditionally remove it before we sign the .dsc file in
case there are leftovers from previous runs.

Closes: #1140788