On 10/11/15 12:17, Nicholas Bamber wrote:
On 10/11/15 11:59, James McCoy wrote:
On Tue, Nov 10, 2015 at 09:56:26AM +0000, Nicholas Bamber wrote:
On the contrary, I think changing Makefiles is much more appropriate.
Installing the completion files in the right place under the right name
should happen regardless of whether this is being packaged in Debian or
a downstream (possibly non-Debian based) distro, so it should happen as
much as possible in the build process, not in the packaging.
Cheers,
Thanks for the clarification. I#m happy to work on that basis. It will
take slightly longer.
James,
My amended patch is ready. I have ran debdiff, sbuild, lintian etc and
installed it locally and tested it. Everything looks good to me. I have
it in git locally so if acceptable all I need to do is push it.
diff -Nru --exclude po4a devscripts-2.15.10/debian/changelog devscripts-2.15.10/debian/changelog
--- devscripts-2.15.10/debian/changelog 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/debian/changelog 2015-11-11 00:18:33.000000000 +0000
@@ -1,8 +1,21 @@
devscripts (2.15.10) UNRELEASED; urgency=medium
+ [ Benjamin Drung ]
* test_uscan: Fix failure in testFileExclusion due to wrong tarfile name
test on Ubuntu.
+ [ Nicholas Bamber ]
+ * Fixed issues with current bash completion (Closes: #804492)
+ - Reorganised scripts/Makefile so that bash completion scripts
+ are installed matching their command names - exception the
+ generic pkgnames.bash_completion .
+ - Where necessary added links to bash completion scripts
+ to debian/links to reuse bash completion code
+ - Removed deprecated "have" mechanism from bash completion scripts.
+ - Removed undefined "$filenames" from chdist.bash_completion
+ - Split debi.bash_completion off from pkgnames.bash_completion
+ and added links for both debi/debc and corrected complete commands
+
-- Benjamin Drung <bdr...@debian.org> Fri, 23 Oct 2015 23:54:58 +0200
devscripts (2.15.9) unstable; urgency=medium
diff -Nru --exclude po4a devscripts-2.15.10/debian/links devscripts-2.15.10/debian/links
--- devscripts-2.15.10/debian/links 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/debian/links 2015-11-10 23:49:04.000000000 +0000
@@ -11,3 +11,24 @@
/usr/share/man/fr/man1/debchange.1.gz /usr/share/man/fr/man1/dch.1.gz
/usr/share/man/fr/man1/pts-subscribe.1.gz /usr/share/man/fr/man1/pts-unsubscribe.1.gz
/usr/share/man/fr/man1/edit-patch.1.gz /usr/share/man/fr/man1/add-patch.1.gz
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/wnpp-alert
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/wnpp-check
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/mk-build-deps
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/rmadison
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/mass-bug
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/debsnap
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/dd-list
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/build-rdeps
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/who-uploads
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/transition-check
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/getbuildlog
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/dcontrol
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/grep-excuses
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/rc-alert
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/bts
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/whodepends
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/dget
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/pts-subscribe
+/usr/share/bash-completion/completions/pkgnames /usr/share/bash-completion/completions/pts-unsubscribe
+/usr/share/bash-completion/completions/debchange /usr/share/bash-completion/completions/dch
+/usr/share/bash-completion/completions/debi /usr/share/bash-completion/completions/debc
diff -Nru --exclude po4a devscripts-2.15.10/scripts/chdist.bash_completion devscripts-2.15.10/scripts/chdist.bash_completion
--- devscripts-2.15.10/scripts/chdist.bash_completion 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/scripts/chdist.bash_completion 2015-11-10 23:50:21.000000000 +0000
@@ -1,4 +1,3 @@
-have chdist &&
_chdist ()
{
local cur=$2 prev=$3
@@ -47,6 +46,6 @@
}
-[ -n "${have:-}" ] && complete -F _chdist $filenames chdist
+complete -F _chdist chdist
diff -Nru --exclude po4a devscripts-2.15.10/scripts/dcut.bash_completion devscripts-2.15.10/scripts/dcut.bash_completion
--- devscripts-2.15.10/scripts/dcut.bash_completion 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/scripts/dcut.bash_completion 2015-11-10 23:50:21.000000000 +0000
@@ -1,4 +1,3 @@
-have dcut &&
_dcut()
{
local cur prev options commands
@@ -43,4 +42,4 @@
return 0
}
-[ "$have" ] && complete -F _dcut -o filenames dcut
+complete -F _dcut -o filenames dcut
diff -Nru --exclude po4a devscripts-2.15.10/scripts/debchange.bash_completion devscripts-2.15.10/scripts/debchange.bash_completion
--- devscripts-2.15.10/scripts/debchange.bash_completion 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/scripts/debchange.bash_completion 2015-11-11 07:20:47.000000000 +0000
@@ -1,4 +1,3 @@
-have debchange &&
_debchange()
{
local cur prev options
@@ -76,5 +75,4 @@
return 0
}
-[ "$have" ] && complete -F _debchange debchange
-[ "$have" ] && complete -F _debchange dch
+complete -F _debchange debchange dch
diff -Nru --exclude po4a devscripts-2.15.10/scripts/debi.bash_completion devscripts-2.15.10/scripts/debi.bash_completion
--- devscripts-2.15.10/scripts/debi.bash_completion 1970-01-01 01:00:00.000000000 +0100
+++ devscripts-2.15.10/scripts/debi.bash_completion 2015-11-11 07:20:22.000000000 +0000
@@ -0,0 +1,11 @@
+_debc()
+{
+ local cur
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ COMPREPLY=($(compgen -f -X '!*.changes' -- "$cur"))
+ if echo "$cur" | grep -qs '^[a-z0-9+.-]*$'; then
+ COMPREPLY=(${COMPREPLY[@]} $(apt-cache pkgnames -- $cur 2> /dev/null))
+ fi
+ return 0
+}
+complete -o dirnames -F _debc debc debi
diff -Nru --exclude po4a devscripts-2.15.10/scripts/debsign.bash_completion devscripts-2.15.10/scripts/debsign.bash_completion
--- devscripts-2.15.10/scripts/debsign.bash_completion 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/scripts/debsign.bash_completion 2015-11-10 23:50:21.000000000 +0000
@@ -1,4 +1,3 @@
-have debsign &&
_debsign()
{
local cur prev options
@@ -27,4 +26,4 @@
return 0
}
-[ "$have" ] && complete -F _debsign -o filenames debsign
+complete -F _debsign -o filenames debsign
diff -Nru --exclude po4a devscripts-2.15.10/scripts/Makefile devscripts-2.15.10/scripts/Makefile
--- devscripts-2.15.10/scripts/Makefile 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/scripts/Makefile 2015-11-11 00:08:36.000000000 +0000
@@ -19,7 +19,8 @@
CWRAPPERS = debpkg-wrapper
SCRIPTS = $(patsubst %.pl,%,$(PL_FILES)) $(patsubst %.sh,%,$(SH_FILES))
COMPL_FILES := $(wildcard *.bash_completion)
-COMPLETION = $(patsubst %.bash_completion,devscripts.%,$(COMPL_FILES))
+BC_BUILD_DIR:=bash_completion
+COMPLETION = $(patsubst %.bash_completion,$(BC_BUILD_DIR)/%,$(COMPL_FILES))
COMPL_DIR := $(shell pkg-config --variable=completionsdir bash-completion)
GEN_MAN1S += devscripts.1 mk-origtargz.1
@@ -70,17 +71,19 @@
perl ../debian/genmanpage.pl >> $@.$(PID)
mv $@.$(PID) $@
-devscripts.%: %.bash_completion
+$(BC_BUILD_DIR):
+ mkdir $(BC_BUILD_DIR)
+
+$(COMPLETION): $(BC_BUILD_DIR)/% : %.bash_completion $(BC_BUILD_DIR)
cp $< $@
clean:
python3 setup.py clean -a
find -name '*.pyc' -delete
find -name __pycache__ -delete
- rm -rf devscripts.egg-info
+ rm -rf devscripts.egg-info $(BC_BUILD_DIR)
rm -f $(SCRIPTS) $(patsubst %,%.tmp,$(SCRIPTS)) \
- $(GEN_MAN1S) $(SCRIPT_LIBS) $(CWRAPPERS) \
- $(COMPLETION)
+ $(GEN_MAN1S) $(SCRIPT_LIBS) $(CWRAPPERS)
test:
$(foreach python,$(shell py3versions -r ../debian/control),$(python) setup.py test$(\n))
@@ -90,7 +93,7 @@
cp $(SCRIPTS) $(DESTDIR)$(BINDIR)
ln -sf edit-patch $(DESTDIR)$(BINDIR)/add-patch
install -d $(DESTDIR)$(COMPL_DIR)
- cp $(COMPLETION) $(DESTDIR)$(COMPL_DIR)
+ cp $(BC_BUILD_DIR)/* $(DESTDIR)$(COMPL_DIR)/
# Special treatment for debpkg
install -d $(DESTDIR)$(DATA_DIR)
mv $(DESTDIR)$(BINDIR)/debpkg $(DESTDIR)$(DATA_DIR)
diff -Nru --exclude po4a devscripts-2.15.10/scripts/pkgnames.bash_completion devscripts-2.15.10/scripts/pkgnames.bash_completion
--- devscripts-2.15.10/scripts/pkgnames.bash_completion 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/scripts/pkgnames.bash_completion 2015-11-10 23:50:21.000000000 +0000
@@ -9,15 +9,4 @@
return 0
}
-_debc()
-{
- local cur
- cur="${COMP_WORDS[COMP_CWORD]}"
- COMPREPLY=($(compgen -f -X '!*.changes' -- "$cur"))
- if echo "$cur" | grep -qs '^[a-z0-9+.-]*$'; then
- COMPREPLY=(${COMPREPLY[@]} $(apt-cache pkgnames -- $cur 2> /dev/null))
- fi
- return 0
-}
-complete -F _pkg_names wnpp-alert wnpp-check mk-build-deps rmadison mass-bug debsnap dd-list build-rdeps who-uploads transition-check getbuildlog dcontrol grep-excuses rc-alert bts whodepends dget pts-subscribe debc pts-unsubscribe
-complete -o dirnames -F _debc debc
+complete -F _pkg_names wnpp-alert wnpp-check mk-build-deps rmadison mass-bug debsnap dd-list build-rdeps who-uploads transition-check getbuildlog dcontrol grep-excuses rc-alert bts whodepends dget pts-subscribe pts-unsubscribe
diff -Nru --exclude po4a devscripts-2.15.10/scripts/uupdate.bash_completion devscripts-2.15.10/scripts/uupdate.bash_completion
--- devscripts-2.15.10/scripts/uupdate.bash_completion 2015-11-11 09:44:19.000000000 +0000
+++ devscripts-2.15.10/scripts/uupdate.bash_completion 2015-11-10 23:50:21.000000000 +0000
@@ -1,4 +1,3 @@
-have uupdate &&
_uupdate()
{
local cur prev options
@@ -29,4 +28,4 @@
return 0
}
-[ "$have" ] && complete -F _uupdate -o filenames uupdate
+complete -F _uupdate -o filenames uupdate