Package: devscripts Version: 2.17.6+deb9u1 Severity: important Tags: patch Hi,
As mentioned on #dd earlier, bash completion for debsign doesn't work: the filename gets completed based on the longest prefix as usual, but if one types e.g. "." for a ".dsc", the rest isn't completed. Looking at the code, acceptable answers (COMPREPLY) are determined by appending a few known suffixes to the current word. This doesn't work once we're past the common part. After a quick research (read: I haven't checked official documentation for best practices, etc.), the attached patch looks reasonable to me: the known suffixes are added as such (instead of as globs using the current word), and results are filtered using the current word. Below, you'll find examples based on my ~/debian-installer directory, with differences before/after applying the patch. ================================================================================================ Before: ------- [1] kibi@armor:~/debian-installer$ debsign debian-installer_201 debian-installer_201611XX_amd64.buildinfo debian-installer_20170615+deb9u2.dsc debian-installer_201611XX_amd64.changes debian-installer_20170615+deb9u2_source.buildinfo debian-installer_20170525.dsc debian-installer_20170615+deb9u2_source.changes debian-installer_20170525_source.changes debian-installer_20170615.dsc debian-installer_20170608_amd64.buildinfo debian-installer_20170615_source.buildinfo debian-installer_20170608_amd64.changes debian-installer_20170615_source.changes debian-installer_20170608.dsc debian-installer_20170828_amd64.buildinfo debian-installer_20170608_source.changes debian-installer_20170828_amd64.changes debian-installer_20170615+deb9u2_amd64.buildinfo debian-installer_20170828.dsc debian-installer_20170615+deb9u2_amd64.changes debian-installer_20170828_source.changes [2] kibi@armor:~/debian-installer$ debsign debian-installer_20170615 debian-installer_20170615+deb9u2_amd64.buildinfo debian-installer_20170615+deb9u2_source.changes debian-installer_20170615+deb9u2_amd64.changes debian-installer_20170615.dsc debian-installer_20170615+deb9u2.dsc debian-installer_20170615_source.buildinfo debian-installer_20170615+deb9u2_source.buildinfo debian-installer_20170615_source.changes [3] kibi@armor:~/debian-installer$ debsign debian-installer_20170615+deb9u2 debian-installer_20170615+deb9u2_amd64.buildinfo debian-installer_20170615+deb9u2_source.buildinfo debian-installer_20170615+deb9u2_amd64.changes debian-installer_20170615+deb9u2_source.changes debian-installer_20170615+deb9u2.dsc [4] kibi@armor:~/debian-installer$ debsign debian-installer_20170615+deb9u2. [nothing] [5] kibi@armor:~/debian-installer$ debsign debian-installer_20170615+deb9u2_amd64. [nothing] ================================================================================================ After: ------ [1] kibi@armor:~/debian-installer$ debsign debian-installer_201 debian-installer_201611XX_amd64.buildinfo debian-installer_20170615+deb9u2.dsc debian-installer_201611XX_amd64.changes debian-installer_20170615+deb9u2_source.buildinfo debian-installer_20170525.dsc debian-installer_20170615+deb9u2_source.changes debian-installer_20170525_source.changes debian-installer_20170615.dsc debian-installer_20170608_amd64.buildinfo debian-installer_20170615_source.buildinfo debian-installer_20170608_amd64.changes debian-installer_20170615_source.changes debian-installer_20170608.dsc debian-installer_20170828_amd64.buildinfo debian-installer_20170608_source.changes debian-installer_20170828_amd64.changes debian-installer_20170615+deb9u2_amd64.buildinfo debian-installer_20170828.dsc debian-installer_20170615+deb9u2_amd64.changes debian-installer_20170828_source.changes [2] kibi@armor:~/debian-installer$ debsign debian-installer_20170615 debian-installer_20170615+deb9u2_amd64.buildinfo debian-installer_20170615+deb9u2_source.changes debian-installer_20170615+deb9u2_amd64.changes debian-installer_20170615.dsc debian-installer_20170615+deb9u2.dsc debian-installer_20170615_source.buildinfo debian-installer_20170615+deb9u2_source.buildinfo debian-installer_20170615_source.changes [3] kibi@armor:~/debian-installer$ debsign debian-installer_20170615+deb9u2 debian-installer_20170615+deb9u2_amd64.buildinfo debian-installer_20170615+deb9u2_source.buildinfo debian-installer_20170615+deb9u2_amd64.changes debian-installer_20170615+deb9u2_source.changes debian-installer_20170615+deb9u2.dsc [4] kibi@armor:~/debian-installer$ debsign debian-installer_20170615+deb9u2. → completes the filename: debian-installer_20170615+deb9u2.dsc [5a] kibi@armor:~/debian-installer$ debsign debian-installer_20170615+deb9u2_amd64. debian-installer_20170615+deb9u2_amd64.buildinfo debian-installer_20170615+deb9u2_amd64.changes [5b] kibi@armor:~/debian-installer$ debsign debian-installer_20170615+deb9u2_amd64.c → completes the filename: debian-installer_20170615+deb9u2_amd64.changes ================================================================================================ Thanks for considering, for unstable and for stretch. KiBi.
>From a8afcc778da9109d85e55ceb5fa6e380f82889ff Mon Sep 17 00:00:00 2001 From: Cyril Brulebois <[email protected]> Date: Sun, 1 Oct 2017 21:10:26 +0200 Subject: [PATCH] debsign: Fix bash completion. Use file extensions instead of globs. --- debian/changelog | 4 ++++ scripts/debsign.bash_completion | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index dd2ecc74..332b60d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,10 @@ devscripts (2.17.11) UNRELEASED; urgency=medium [ Christoph Berg ] * origtargz: Allow invocation from subdirectory. (Closes: #702636) + [ Cyril Brulebois ] + * debsign: Fix bash completion by using file extensions instead of + using globs. + -- Chris Lamb <[email protected]> Wed, 27 Sep 2017 13:24:39 +0100 devscripts (2.17.10) unstable; urgency=medium diff --git a/scripts/debsign.bash_completion b/scripts/debsign.bash_completion index 21ea89e9..ebaaa7fd 100644 --- a/scripts/debsign.bash_completion +++ b/scripts/debsign.bash_completion @@ -19,10 +19,10 @@ _debsign() ;; *) COMPREPLY=( $( - compgen -G "${cur}*.changes" - compgen -G "${cur}*.buildinfo" - compgen -G "${cur}*.dsc" - compgen -G "${cur}*.commands" + compgen -f -X "!*.changes" -- "$cur" + compgen -f -X "!*.buildinfo" -- "$cur" + compgen -f -X "!*.dsc" -- "$cur" + compgen -f -X "!*.commands" -- "$cur" compgen -W "$options" | grep "^$cur" ) ) ;; -- 2.11.0
_______________________________________________ devscripts-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel
