Hi Guillem,

Here is v2 of the series. It no longer contains the --sign-pause fix,
since you have merged that locally already. Patch 1/2 is new (the
.gitignore change), and patch 2/2 is the updated completion file.

> But it seems some of my changes complement some of yours. So it would
> make sense if you adopted some of those into your patch?

I fetched your pu/bash-completions branch (4198c5e9b) and compared it
with mine. I adopted your approach of completing --sign-command with a
curated list: mine used _comp_compgen_commands, which expands to 7024
entries here, so it was not usable interactively.

My values differ from yours in two ways. First, neither auto nor none is
offered, as dpkg-buildpackage validates the value with find_command()
before it reaches the backend (scripts/dpkg-buildpackage.pl:674), so
both error out with "sign-command 'auto' not found". Second, the *v
commands (sqopv, rsopv, sqv, gpgv-sq and gpgv) are the verification
commands (DEFAULT_CMDV), rather than the signing ones. The final list is
the DEFAULT_CMD of each supported backend, in the backend preference
order from dpkg-buildpackage(1).

I did not adopt -x dpkg_architecture, because the xfunc is defined in
the dpkg-architecture completion file, which is not in main yet; adding
it now makes --host-arch complete nothing. I will switch to it once that
file lands.

> Right, it looks I was also bothered by this, and ended up adding negated
> entries (in a commit in that branch). But I think I do prefer your
> proposed fix better. So feel free to provide a patch for that.

Patch 1/2 does this. It anchors every entry in scripts/, src/, dselect/
and utils/, which are the four directories containing a completion/bash/
subdirectory. Once it is applied, the negated entries you added in
3c498a0c3 will no longer be needed.

> Nice catch as well. I was curious whether the current completion files
> were fine, so added this locally now (with attribution), and fixed a
> couple of issues with the dpkg-deb completion.

Thank you, both for adding the test and for the attribution.

Best regards,
Cheng Li

Reply via email to