🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #2677

Bug#1061450: dpkg-dev: Please add bash completion for dpkg-buildpackage

#2677
From: Cheng Li
Date: Fri, 30 Oct 2026 11:50
79 lines
6582 bytes
Control: tags -1 + patch

Hi Guillem,

Here is the patch series you asked for back in July; sorry for the long
delay.  It is two patches on top of current main (7492eb3d9).

Patch 1 fixes a bug I ran into while enumerating the options.  The
--help output has documented -ap's long form as --sign-pause since the
long options were added in 1.18.8 (293bd243a), but the parser was
written as --sign-pausa, so the documented spelling has never been
accepted, and the accepted one has never been documented, neither in
--help nor in the man page.  I did not keep the misspelling as a
deprecated alias: it was never part of the documented interface, and
-ap has always worked, so there is nothing to deprecate; --sign-pausa
now gets the usual unknown option error, which names the option.  The
patch also adds the man page entry, which has been missing all along,
annotated as "Support for long option since dpkg 1.23.12", as that is
when the long option starts to actually work; please adjust if this
lands in a different release.  A test asserts that the documented
spelling is accepted.

Patch 2 is the completion itself, following the dpkg-source file on
main and the bash-completion 2.12 API, together with the packaging
bits, in the shape of 9d6fa2c83.  It completes option names and, where
there is something sensible to offer, option values: build types, rules
targets, architectures, build profiles, OpenPGP backends, compression
parameters, command arguments for --root-command, --sign-command,
--check-command and --hook-*, pathname arguments, and the positional
.dsc file or source directory.  The --buildinfo-id, -E and -W options
are deliberately not completed, as they are accepted but have no
effect.

One packaging note: debian/dpkg-dev.install lists the files
individually, and with debhelper compat 13 dh_missing --fail-missing is
the default, so without that line dpkg's own package build fails.

I tested the completion with an offline harness that drives the
function directly (26 cases, covering option names and values) against
bash-completion 2.16; make check passes in a configured tree; and a
full "dpkg-buildpackage -b" of dpkg itself succeeds, with dh_missing
quiet and lintian reporting nothing on dpkg-dev.

Two unrelated things I noticed, both happy to turn into patches if you
want them:

- scripts/.gitignore uses unanchored script names, so the new
  completion file matches the "dpkg-buildpackage" entry and needs
  git add -f; the imported dpkg-source completion has the same
  property.  Anchoring the entries with a leading "/" would avoid it.

- Test::Dpkg::all_shell_files does not pick up
  scripts/completion/bash/, so t/shellcheck.t has never covered the
  completion files, dpkg-source included.  I ran shellcheck by hand
  with the exclude list from t/shellcheck.t, which is how I noticed
  SC1010 on the "done" hook name; patch 2 quotes it.

I can also push the series as a branch to my Salsa fork if that is
easier to look at, and I am happy to rework anything.

Best regards,
Cheng Li

Cheng Li (2):
  dpkg-buildpackage: Fix --sign-pause long option name
  completion: Add bash completion for dpkg-buildpackage

 debian/copyright                          |   1 +
 debian/dpkg-dev.install                   |   1 +
 man/dpkg-buildpackage.pod                 |   7 +
 scripts/Makefile.am                       |   1 +
 scripts/completion/bash/dpkg-buildpackage | 170 ++++++++++++++++++++++
 scripts/dpkg-buildpackage.pl              |   2 +-
 scripts/t/dpkg_buildpackage.t             |  17 ++-
 7 files changed, 197 insertions(+), 2 deletions(-)
 create mode 100644 scripts/completion/bash/dpkg-buildpackage

-- 
2.47.3
Technical Details
Message-ID: <NTThn-8NZ9-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <NiU2J-5SFU-15@gated-at.bofh.it> <HZQX0-5jPa-15@gated-at.bofh.it> <NiU2J-5SFU-15@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Cheng Li <shiptux@gmail.com>
Newsgroups: linux.debian.bugs.dist,linux.debian.maint.dpkg
Subject: Bug#1061450: dpkg-dev: Please add bash completion for dpkg-buildpackage
Date: Fri, 30 Oct 2026 12:50:01 +0100
Message-ID: <NTThn-8NZ9-3@gated-at.bofh.it>
References: <NiU2J-5SFU-15@gated-at.bofh.it> <HZQX0-5jPa-15@gated-at.bofh.it> <NiU2J-5SFU-15@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Fri Oct 30 11:45:16 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -0.547
Reply-To: Cheng Li <shiptux@gmail.com>, 1061450@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: debian-dpkg@lists.debian.org
X-Debian-Pr-Message: followup 1061450
X-Debian-Pr-Package: dpkg-dev
X-Debian-Pr-Keywords: newcomer
X-Debian-Pr-Source: dpkg
X-Gm-Message-State: AFq9FYK17oGtpMdTRnutAJYORn/uV0N9Z+mPfRWdd4jQIro6kRfnLIdu
	g6rDBWma1n66Ph4vepL6wREmw0+z/f9fkWROYFocvfwRTJGdnS/U4uvcW2l4IB9yBiM=
X-Gm-Gg: AYBFou035GaMrk1ClfPfoHZCamZlReLywHCL4lIf+XSTJ2TVo4J/QTWGYzLlSOAnPhk
	BbEAUaIxfO2UTnpWJ9/vkBqY8dZHJ/Ve0W5psm7E+1fbenRlTVisfeOOYKxXjXs6QqHMZ7gCXDb
	rw6RGcq7VqnRoedY7/jM6Vvg93dNXjbYZydD7P0OFsjqjfy0zUhB/UCjiGSvpEuFF0ghb1y/Cqh
	EA+iH5WnsWo3p+2jtE1wGly1vY6dxD0lC8EAmhfCRxLYv34ZR58yo6dOJJ3U153JmbywcsKiOuO
	wnEvmCxdOIXNXlIlH9pjGty7b3K/+laNYtsGUg05cgiGj5D+xBAGwWQpm807aSmhALc/wupgKGU
	Kg2ERHIPJX8Dx95sbIbp1l1uai25XzZq6bJ1WLIeQ4YvUVcPkR3lG/vobknyn/sCT20JEHMZwB2
	A71phxvLnI8oXYHhulerUXMW8yOQ/6MSd/L4MgsU6hkERV0X7aNh4+loPSwyRKtR/zC7x8nFMvQ
	/EGajKRrZDtOVfj7VNIVAJaki4WzbLqxK9OptVOIxi9H57GdP339tg+EmKlRQtQXEc8wmWGDgO1
	111wwICkk8e+jnMhztYvIj1/vEUVKFYO6Cb2gEzbrC6X7ORZiz8KY7XaDoBsGpwwurQrhumVwck
	jGYVbTOLK
X-Received: by 2002:a05:7301:4306:b0:369:44b3:99c0 with SMTP id 5a478bee46e88-36a42340c9bmr3002761eec.8.1793360654432;
        Fri, 30 Oct 2026 04:44:14 -0700 (PDT)
X-Mailer: git-send-email 2.47.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1999763
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 79
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: Guillem Jover <guillem@debian.org>
X-Original-Date: Fri, 30 Oct 2026 20:44:01 +0900
X-Original-Message-ID: <20261030114403.269830-1-shiptux@gmail.com>
X-Original-References: <al4AGH88sNs6pESm@thunder.hadrons.org> <170612389523.16223.12946706258590361740.reportbug@ag474u.eng.vyatta.net> <al4AGH88sNs6pESm@thunder.hadrons.org>