- Apply upstream post 1.1 generic vncviewer fixes.

- Autoinstall vncviewer completion also on tigervnc.
- Autoinstall chsh completion also on util-linux.
This commit is contained in:
Ville Skyttä 2009-12-26 11:52:25 +00:00
parent 0e9863bec9
commit 12ed1e36ca
2 changed files with 54 additions and 3 deletions

View File

@ -0,0 +1,43 @@
diff --git a/contrib/vncviewer b/contrib/vncviewer
index 1e6e3eb..d3e5c59 100644
--- a/contrib/vncviewer
+++ b/contrib/vncviewer
@@ -1,22 +1,27 @@
# bash completion for vncviewer
have vncviewer &&
-_vncviewer_bootstrap() {
+_vncviewer_bootstrap()
+{
local fname
case "$(_realcommand vncviewer)" in
- # If `vncviewer' not installed, default file-dir completion
- '') _filedir `_get_cword` ;;
*xvnc4viewer) fname=_xvnc4viewer ;;
- *tightvncviewer|*) fname=_tightvncviewer ;;
+ *tightvncviewer) fname=_tightvncviewer ;;
+ *) fname=_vncviewer ;;
esac
- if [ $fname ]; then
- # Install real completion for subsequent completions
- complete -F $fname vncviewer
- $fname # Generate completions once for now
- unset -f _vncviewer_bootstrap
- fi
+
+ # Install real completion for subsequent completions
+ complete -F $fname vncviewer
+ $fname # Generate completions once for now
+ unset -f _vncviewer_bootstrap
} &&
-complete -F _vncviewer_bootstrap vncviewer
+complete -F _vncviewer_bootstrap vncviewer &&
+_vncviewer()
+{
+ COMPREPLY=()
+ local cur=`_get_cword`
+ _known_hosts_real "$cur"
+}
have tightvncviewer &&
_tightvncviewer()

View File

@ -1,6 +1,6 @@
Name: bash-completion
Version: 1.1
Release: 4%{?dist}
Release: 5%{?dist}
Epoch: 1
Summary: Programmable completion for Bash
@ -13,6 +13,8 @@ Source1: %{name}-plague-client
Source2: http://bash-completion.alioth.debian.org/files/CHANGES-1.1
# http://git.debian.org/?p=bash-completion/bash-completion.git;a=blob_plain;f=bash_completion.sh;h=915960b614ef7644f9abaa99ed9ef0faa7ac5477;hb=HEAD
Source3: bash_completion.sh
# From upstream post 1.1.
Patch0: %{name}-1.1-vncviewer.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@ -27,6 +29,7 @@ of the programmable completion feature of bash 2.
%prep
%setup -q
%patch0 -p1
install -pm 644 %{SOURCE1} contrib/plague-client
install -pm 644 %{SOURCE2} CHANGES
install -pm 644 %{SOURCE3} bash_completion.sh
@ -122,7 +125,7 @@ rm -rf $RPM_BUILD_ROOT
%bashcomp_trigger bzip2
%bashcomp_trigger cfengine
%bashcomp_trigger chkconfig
%bashcomp_trigger chsh util-linux-ng
%bashcomp_trigger chsh util-linux-ng,util-linux
%bashcomp_trigger cksfv
%bashcomp_trigger clisp
%bashcomp_trigger cpan2dist perl-CPANPLUS
@ -246,7 +249,7 @@ fi
%bashcomp_trigger tcpdump
%bashcomp_trigger unace
%bashcomp_trigger unrar
%bashcomp_trigger vncviewer vnc
%bashcomp_trigger vncviewer tigervnc,vnc
%bashcomp_trigger vpnc
%bashcomp_trigger wireless-tools
%bashcomp_trigger wodim
@ -289,6 +292,11 @@ fi
%changelog
* Sat Dec 26 2009 Ville Skyttä <ville.skytta@iki.fi> - 1:1.1-5
- Apply upstream post 1.1 generic vncviewer fixes.
- Autoinstall vncviewer completion also on tigervnc.
- Autoinstall chsh completion also on util-linux.
* Tue Dec 15 2009 Ville Skyttä <ville.skytta@iki.fi> - 1:1.1-4
- Fix autoinstall of completions named other than the package (#546905).
- Use environment-modules upstream completion instead of ours if available.