summaryrefslogtreecommitdiff
path: root/extra/source/bash-completion
diff options
context:
space:
mode:
Diffstat (limited to 'extra/source/bash-completion')
-rwxr-xr-xextra/source/bash-completion/bash-completion.SlackBuild24
-rw-r--r--extra/source/bash-completion/fixup-sh-script-completions.diff31
-rw-r--r--extra/source/bash-completion/patches/0001-tar-Don-t-write-to-tmp-jetel.patch25
-rw-r--r--extra/source/bash-completion/patches/0002-test-suite-Add-tar-xvf-filename-test-case.patch27
-rw-r--r--extra/source/bash-completion/patches/0003-tar-Fix-GNU-tar-help-output-parsing-regex-fixes-15.patch25
-rw-r--r--extra/source/bash-completion/patches/0004-tar-Remove-unused-variable.patch25
-rw-r--r--extra/source/bash-completion/patches/0005-tar-Detect-GNU-other-from-version-only-once-per-sess.patch46
-rw-r--r--extra/source/bash-completion/patches/0006-Remove-mplayer-aliased-completion.patch22
-rw-r--r--extra/source/bash-completion/slack-desc10
9 files changed, 209 insertions, 26 deletions
diff --git a/extra/source/bash-completion/bash-completion.SlackBuild b/extra/source/bash-completion/bash-completion.SlackBuild
index 7a4634f8..fd7206aa 100755
--- a/extra/source/bash-completion/bash-completion.SlackBuild
+++ b/extra/source/bash-completion/bash-completion.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2009, 2010, 2011, 2012, 2014, 2015, 2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,9 +22,9 @@
# Slackware build script for bash-completion
-VERSION=2.1
+VERSION=2.2
ARCH=noarch
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-3}
CWD=$(pwd)
TMP=${TMP:-/tmp}
@@ -46,16 +46,32 @@ find . \
# Fixup sh completion for us
zcat $CWD/fixup-sh-script-completions.diff.gz | patch -p1 --verbose || exit 1
+# Add some patches from git to fix tar filename completion and related
+# https://github.com/scop/bash-completion/issues/15
+zcat $CWD/patches/0001-tar-Don-t-write-to-tmp-jetel.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0002-test-suite-Add-tar-xvf-filename-test-case.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0003-tar-Fix-GNU-tar-help-output-parsing-regex-fixes-15.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0004-tar-Remove-unused-variable.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0005-tar-Detect-GNU-other-from-version-only-once-per-sess.patch.gz | patch -p1 --verbose || exit 1
+
+# Don't symlink mpv -> mplayer as it reportedly doesn't work well. Upstream patch.
+zcat $CWD/patches/0006-Remove-mplayer-aliased-completion.patch.gz | patch -p1 --verbose || exit 1
+
+autoreconf -vif
+
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/man \
--infodir=/usr/info \
- --docdir=/usr/doc/bash-completion-$VERSION
+ --docdir=/usr/doc/bash-completion-$VERSION || exit 1
make || exit 1
make install DESTDIR=$PKG || exit 1
+# Create the local directory for admin changes/additions:
+mkdir -p $PKG/etc/bash_completion.d/
+
chmod 0755 $PKG/etc/profile.d/bash_completion.sh
mkdir -p $PKG/usr/doc/bash-completion-$VERSION
diff --git a/extra/source/bash-completion/fixup-sh-script-completions.diff b/extra/source/bash-completion/fixup-sh-script-completions.diff
index 15bcf1d1..6f3447b8 100644
--- a/extra/source/bash-completion/fixup-sh-script-completions.diff
+++ b/extra/source/bash-completion/fixup-sh-script-completions.diff
@@ -1,22 +1,19 @@
-The 'sh' completion file only completes on *.sh files.
-This breaks the expectation (on Slackware, at least) that
-e.g. "sh /etc/rc.d/rc.my<TAB>" will complete to rc.mysql.
-This patch fixes that, but a consequence is that "sh" will
-complete on *any* filename. IMHO, that's not a regression
-at all, since stock bash without bash-completion does that
-already... --rworkman
+The 'sh' completion file only completes on *.sh files. This breaks the
+expectation (on Slackware, at least) that e.g. "sh /etc/rc.d/rc.my<TAB>"
+will complete to rc.mysql. This patch fixes that, but a consequence is that
+"sh" will complete on *any* filename. IMHO, that's not a regression at all,
+since stock bash without bash-completion does that already... --rworkman
Acked-by: volkerdi
-diff -Nur bash-completion-1.3.orig/completions/sh bash-completion-1.3/completions/sh
---- bash-completion-1.3.orig/completions/sh 2011-01-21 03:36:11.000000000 -0600
-+++ bash-completion-1.3/completions/sh 2011-03-12 02:06:00.964938285 -0600
-@@ -28,7 +28,7 @@
- return 0
- fi
-
-- _filedir sh
-+ _filedir
+diff -Nur bash-completion-2.2.orig/completions/sh bash-completion-2.2/completions/sh
+--- bash-completion-2.2.orig/completions/sh 2016-02-09 08:52:44.000000000 -0600
++++ bash-completion-2.2/completions/sh 2016-03-06 00:43:49.744767271 -0600
+@@ -31,6 +31,6 @@
+ [[ $args -eq 1 ]] && ext=sh
+ _filedir $ext
} &&
- complete -F _sh sh
+-complete -F _sh sh
++complete -F _sh
+ # ex: ts=4 sw=4 et filetype=sh
diff --git a/extra/source/bash-completion/patches/0001-tar-Don-t-write-to-tmp-jetel.patch b/extra/source/bash-completion/patches/0001-tar-Don-t-write-to-tmp-jetel.patch
new file mode 100644
index 00000000..82cbeb0d
--- /dev/null
+++ b/extra/source/bash-completion/patches/0001-tar-Don-t-write-to-tmp-jetel.patch
@@ -0,0 +1,25 @@
+From 6bdd92202f55d7c530dcbeb2a243604dac546cf1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
+Date: Tue, 15 Mar 2016 19:49:55 +0200
+Subject: [PATCH 1/5] tar: Don't write to /tmp/jetel
+
+---
+ completions/tar | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/completions/tar b/completions/tar
+index ef18ad6..6e4c74c 100644
+--- a/completions/tar
++++ b/completions/tar
+@@ -411,7 +411,7 @@ __tar_try_list_archive()
+ shift
+
+ read tarball <<<"$(printf -- '%s\n' "$@" \
+- | command sed -n "/^.\{1,\}$regex\$/p" | tee /tmp/jetel)"
++ | command sed -n "/^.\{1,\}$regex\$/p")"
+ if [[ -n "$tarball" ]]; then
+ local IFS=$'\n'
+ COMPREPLY=($(compgen -o filenames -W "$(
+--
+2.7.2
+
diff --git a/extra/source/bash-completion/patches/0002-test-suite-Add-tar-xvf-filename-test-case.patch b/extra/source/bash-completion/patches/0002-test-suite-Add-tar-xvf-filename-test-case.patch
new file mode 100644
index 00000000..8e647374
--- /dev/null
+++ b/extra/source/bash-completion/patches/0002-test-suite-Add-tar-xvf-filename-test-case.patch
@@ -0,0 +1,27 @@
+From 807f903f86ad647425c83f7ad6fc499014c6734e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
+Date: Tue, 15 Mar 2016 20:19:10 +0200
+Subject: [PATCH 2/5] test suite: Add tar xvf filename test case
+
+---
+ test/lib/completions/tar.exp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/test/lib/completions/tar.exp b/test/lib/completions/tar.exp
+index 70e38d0..7cdef94 100644
+--- a/test/lib/completions/tar.exp
++++ b/test/lib/completions/tar.exp
+@@ -59,6 +59,10 @@ set test "old option: create and members"
+ assert_complete_dir "dir/ dir2/ archive.tar.xz escape.tar" "tar cTfvv NOT_EXISTS DONT_CREATE.tar " $::srcdir/fixtures/tar
+ sync_after_int
+
++set test "old option: extract and archive"
++assert_complete_dir "dir/ dir2/ archive.tar.xz escape.tar" "tar xvf " $::srcdir/fixtures/tar
++sync_after_int
++
+ if { "$tar_version" == "gnu" } {
+ set test "check short options"
+ assert_complete_any "tar -c"
+--
+2.7.2
+
diff --git a/extra/source/bash-completion/patches/0003-tar-Fix-GNU-tar-help-output-parsing-regex-fixes-15.patch b/extra/source/bash-completion/patches/0003-tar-Fix-GNU-tar-help-output-parsing-regex-fixes-15.patch
new file mode 100644
index 00000000..621ccd12
--- /dev/null
+++ b/extra/source/bash-completion/patches/0003-tar-Fix-GNU-tar-help-output-parsing-regex-fixes-15.patch
@@ -0,0 +1,25 @@
+From 0b7189d4eee4597e11cab02e6b4dcae488db5ca8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
+Date: Wed, 16 Mar 2016 12:28:29 +0200
+Subject: [PATCH 3/5] tar: Fix GNU tar help output parsing regex, fixes #15
+
+---
+ completions/tar | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/completions/tar b/completions/tar
+index 6e4c74c..0a5f588 100644
+--- a/completions/tar
++++ b/completions/tar
+@@ -105,7 +105,7 @@ __gnu_tar_parse_help()
+ # or more options separated by ', ' separator string. We are matching
+ # like this then: ^<spaces>(<separator>?<option>)+<whatever>$
+ if [[ "$line" =~ \
+- ^[[:blank:]]{1,10}(((,[[:blank:]])?(--?([\]\[a-zA-Z0-9?-=]+))(,[[:space:]])?)+).*$ ]]; then
++ ^[[:blank:]]{1,10}(((,[[:blank:]])?(--?([\]\[a-zA-Z0-9?=-]+))(,[[:space:]])?)+).*$ ]]; then
+
+ line=${BASH_REMATCH[1]}
+ str="${line//,/ }"
+--
+2.7.2
+
diff --git a/extra/source/bash-completion/patches/0004-tar-Remove-unused-variable.patch b/extra/source/bash-completion/patches/0004-tar-Remove-unused-variable.patch
new file mode 100644
index 00000000..767d9bc9
--- /dev/null
+++ b/extra/source/bash-completion/patches/0004-tar-Remove-unused-variable.patch
@@ -0,0 +1,25 @@
+From 7ab05bf9d97ce5a6ced7acdfc21235e06542c3f2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
+Date: Wed, 16 Mar 2016 12:39:06 +0200
+Subject: [PATCH 4/5] tar: Remove unused variable
+
+---
+ completions/tar | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/completions/tar b/completions/tar
+index 0a5f588..9c44dc7 100644
+--- a/completions/tar
++++ b/completions/tar
+@@ -696,7 +696,7 @@ _posix_tar()
+
+ _tar()
+ {
+- local cmd=${COMP_WORDS[0]} output line
++ local cmd=${COMP_WORDS[0]} line
+ read line <<<"$($cmd --version)"
+ case "$line" in
+ *GNU*)
+--
+2.7.2
+
diff --git a/extra/source/bash-completion/patches/0005-tar-Detect-GNU-other-from-version-only-once-per-sess.patch b/extra/source/bash-completion/patches/0005-tar-Detect-GNU-other-from-version-only-once-per-sess.patch
new file mode 100644
index 00000000..3e5e06e0
--- /dev/null
+++ b/extra/source/bash-completion/patches/0005-tar-Detect-GNU-other-from-version-only-once-per-sess.patch
@@ -0,0 +1,46 @@
+From 88c671a2c74bfde3bc2ec7c6f74133ac613c61da Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
+Date: Wed, 16 Mar 2016 12:44:40 +0200
+Subject: [PATCH 5/5] tar: Detect GNU/other from --version only once per
+ session
+
+---
+ completions/tar | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/completions/tar b/completions/tar
+index 9c44dc7..7b3a486 100644
+--- a/completions/tar
++++ b/completions/tar
+@@ -696,16 +696,25 @@ _posix_tar()
+
+ _tar()
+ {
+- local cmd=${COMP_WORDS[0]} line
++ local cmd=${COMP_WORDS[0]} func line
+ read line <<<"$($cmd --version)"
+ case "$line" in
+ *GNU*)
+- _gtar "$@"
++ func=_gtar
+ ;;
+ *)
+- _posix_tar "$@"
++ func=_posix_tar
+ ;;
+ esac
++ $func "$@"
++
++ # Install real completion for subsequent completions
++ if [ -n "${COMP_TAR_INTERNAL_PATHS:-}" ]; then
++ complete -F $func -o dirnames tar
++ else
++ complete -F $func tar
++ fi
++ unset -f _tar
+ }
+
+
+--
+2.7.2
+
diff --git a/extra/source/bash-completion/patches/0006-Remove-mplayer-aliased-completion.patch b/extra/source/bash-completion/patches/0006-Remove-mplayer-aliased-completion.patch
new file mode 100644
index 00000000..7046f89e
--- /dev/null
+++ b/extra/source/bash-completion/patches/0006-Remove-mplayer-aliased-completion.patch
@@ -0,0 +1,22 @@
+--- ./completions/Makefile.in.orig 2016-03-03 06:12:35.000000000 -0600
++++ ./completions/Makefile.in 2016-05-31 14:01:42.323415707 -0500
+@@ -1236,7 +1236,7 @@
+ rm -f $(targetdir)/$$file && \
+ $(LN_S) mcrypt $(targetdir)/$$file ; \
+ done
+- for file in mplayer2 mencoder gmplayer kplayer mpv ; do \
++ for file in mplayer2 mencoder gmplayer kplayer ; do \
+ rm -f $(targetdir)/$$file && \
+ $(LN_S) mplayer $(targetdir)/$$file ; \
+ done
+--- ./completions/Makefile.am.orig 2016-03-02 13:42:58.000000000 -0600
++++ ./completions/Makefile.am 2016-05-31 14:01:33.554416246 -0500
+@@ -802,7 +802,7 @@
+ rm -f $(targetdir)/$$file && \
+ $(LN_S) mcrypt $(targetdir)/$$file ; \
+ done
+- for file in mplayer2 mencoder gmplayer kplayer mpv ; do \
++ for file in mplayer2 mencoder gmplayer kplayer ; do \
+ rm -f $(targetdir)/$$file && \
+ $(LN_S) mplayer $(targetdir)/$$file ; \
+ done
diff --git a/extra/source/bash-completion/slack-desc b/extra/source/bash-completion/slack-desc
index 12687b69..8f9e35b7 100644
--- a/extra/source/bash-completion/slack-desc
+++ b/extra/source/bash-completion/slack-desc
@@ -9,11 +9,11 @@
bash-completion: bash-completion (programmable completion for the bash shell)
bash-completion:
bash-completion: Adds programmable completion to the bash shell. A new file called
-bash-completion: /etc/bash_completion will be sourced for interactive bash shells
-bash-completion: adding all sorts of enhanced command completion features. Once
-bash-completion: installed, you may get a list of all commands that have associated
-bash-completion: completions with 'complete -p', and examine the code for the shell
-bash-completion: functions with 'declare -f'.
+bash-completion: /etc/profile.d/bash_completion.sh will be sourced for interactive
+bash-completion: bash shells adding all sorts of enhanced command completion features.
+bash-completion: Once installed, you may get a list of all commands that have
+bash-completion: associated completions with 'complete -p', and examine the code for
+bash-completion: the shell functions with 'declare -f'.
bash-completion:
bash-completion: Homepage: https://alioth.debian.org/projects/bash-completion/
bash-completion: