diff --git a/.gitignore b/.gitignore index b4138f1..ca062e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -bash-completion-1.1.tar.bz2 -CHANGES-1.1 +bash-completion-1.2.tar.bz2 diff --git a/bash-completion-1.1-service.patch b/bash-completion-1.1-service.patch deleted file mode 100644 index e1555db..0000000 --- a/bash-completion-1.1-service.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 3a205c536c3c811b393d635799d19cf9209ca84a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Skytt=C3=A4?= -Date: Tue, 3 Nov 2009 23:36:01 +0200 -Subject: [PATCH] Fix service argument completion. - ---- - bash_completion | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/bash_completion b/bash_completion -index e1c4054..6f1978c 100644 ---- a/bash_completion -+++ b/bash_completion -@@ -757,7 +757,7 @@ deinstall clean clean-depends kernel buildworld' make - _services - else - COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ -- s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\1/p" \ -+ s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ - $sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) ) - fi - --- -1.7.0 - diff --git a/bash-completion-1.1-vncviewer.patch b/bash-completion-1.1-vncviewer.patch deleted file mode 100644 index 6de66a7..0000000 --- a/bash-completion-1.1-vncviewer.patch +++ /dev/null @@ -1,43 +0,0 @@ -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() diff --git a/bash-completion-1.2-init.d.patch b/bash-completion-1.2-init.d.patch new file mode 100644 index 0000000..d1fef29 --- /dev/null +++ b/bash-completion-1.2-init.d.patch @@ -0,0 +1,19 @@ +diff --git a/contrib/service b/contrib/service +index 9ebd117..6efd7c1 100644 +--- a/contrib/service ++++ b/contrib/service +@@ -32,9 +32,11 @@ _service() + return 0 + } && + complete -F _service service +-[ -d /etc/init.d/ ] && complete -F _service -o default \ +- $(for i in /etc/init.d/*; do +- complete -p ${i##*/} &>/dev/null || printf '%s\n' ${i##*/}; done) ++for svc in /etc/init.d/*; do ++ [ ! -x "$svc" ] || complete -p "${svc##*/}" &>/dev/null || \ ++ complete -F _service -o default "${svc##*/}" ++done ++unset svc + + # Local variables: + # mode: shell-script diff --git a/bash-completion-1.2-known_hosts-ipv6-630658.patch b/bash-completion-1.2-known_hosts-ipv6-630658.patch new file mode 100644 index 0000000..40a279e --- /dev/null +++ b/bash-completion-1.2-known_hosts-ipv6-630658.patch @@ -0,0 +1,14 @@ +diff --git a/bash_completion b/bash_completion +index f7e1a28..98f35ca 100644 +--- a/bash_completion ++++ b/bash_completion +@@ -1298,8 +1298,7 @@ _known_hosts_real() + COMPREPLY=( "${COMPREPLY[@]}" $( awk 'BEGIN {FS=","} + /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \ + gsub(" .*$", "", $i); \ +- gsub("[\\[\\]]", "", $i); \ +- gsub(":[0-9]+$", "", $i); \ ++ sub("^\\[", "", $i); sub("\\](:[0-9]+)?$", "", $i); \ + if ($i ~ /'"$awkcur"'/) {print $i} \ + }}' "${kh[@]}" 2>/dev/null ) ) + fi diff --git a/bash-completion-1.2-rpm-630328.patch b/bash-completion-1.2-rpm-630328.patch new file mode 100644 index 0000000..a1aa20d --- /dev/null +++ b/bash-completion-1.2-rpm-630328.patch @@ -0,0 +1,78 @@ +diff --git a/contrib/rpm b/contrib/rpm +index 20f9852..d268cab 100644 +--- a/contrib/rpm ++++ b/contrib/rpm +@@ -142,7 +142,7 @@ _rpm() + -- "$cur" ) ) + return 0 + ;; +- --define|-D) ++ --define|-D|--fileid|--hdrid|--pkgid) + # argument required but no completions available + return 0 + ;; +@@ -180,12 +180,11 @@ _rpm() + # options common to all query types + opts="$opts --changelog --configfiles --conflicts --docfiles + --dump --enhances --filesbypkg --filecaps --fileclass +- --filecolor --fileprovide --filerequire --filesbypkg +- --info --list --obsoletes --pipe --provides +- --queryformat --rcfile --requires --scripts --suggests +- --triggeredby --triggers --whatprovides --whatrequires --xml" ++ --filecolor --fileprovide --filerequire --filesbypkg --info ++ --list --obsoletes --pipe --provides --queryformat --rcfile ++ --requires --scripts --suggests --triggers --xml" + +- if [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then ++ if [[ $COMP_LINE == *\ -@(*([^ -])f|-file )* ]]; then + # -qf completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext \ +@@ -193,23 +192,26 @@ _rpm() + else + _filedir + fi +- elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then ++ elif [[ $COMP_LINE == *\ -@(*([^ -])g|-group )* ]]; then + # -qg completion + _rpm_groups +- elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then ++ elif [[ $COMP_LINE == *\ -@(*([^ -])p|-package )* ]]; then + # -qp; uninstalled package completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy \ +- --httpport --httpproxy" -- "$cur" ) ) ++ --httpport --httpproxy --nomanifest" -- "$cur" ) ) + else + _filedir 'rpm' + fi + else + # -q; installed package completion + if [[ "$cur" == -* ]]; then +- COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext \ +- --last --root --state" -- "$cur" ) ) +- elif [ "${COMP_LINE#* -*([^ -])a}" == "$COMP_LINE" ]; then ++ COMPREPLY=( $( compgen -W "$opts --all --file --fileid ++ --dbpath --fscontext --ftswalk --group --hdrid --last ++ --package --pkgid --root --specfile --state ++ --triggeredby --whatprovides --whatrequires" \ ++ -- "$cur" ) ) ++ elif [[ $COMP_LINE != *\ -@(*([^ -])a|-all )* ]]; then + _rpm_installed_packages "$nodig" "$nosig" + fi + fi +@@ -229,11 +231,11 @@ _rpm() + --nofiles --noscripts --nomd5 --querytags --specfile \ + --whatrequires --whatprovides" -- "$cur" ) ) + # check whether we're doing file completion +- elif [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then ++ elif [[ $COMP_LINE == *\ -@(*([^ -])f|-file )* ]]; then + _filedir +- elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then ++ elif [[ $COMP_LINE == *\ -@(*([^ -])g|-group )* ]]; then + _rpm_groups +- elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then ++ elif [[ $COMP_LINE == *\ -@(*([^ -])p|-package )* ]]; then + _filedir 'rpm' + else + _rpm_installed_packages "$nodig" "$nosig" diff --git a/bash-completion-1.2-tilde-username-628130.patch b/bash-completion-1.2-tilde-username-628130.patch new file mode 100644 index 0000000..ef56fd4 --- /dev/null +++ b/bash-completion-1.2-tilde-username-628130.patch @@ -0,0 +1,117 @@ +diff --git a/bash_completion b/bash_completion +index 53eea33..e1e926b 100644 +--- a/bash_completion ++++ b/bash_completion +@@ -618,7 +618,7 @@ _filedir() + { + local i IFS=$'\t\n' xspec + +- __expand_tilde_by_ref cur ++ _tilde "$cur" || return 0 + + local -a toks + local quoted tmp +@@ -803,7 +803,26 @@ _available_interfaces() + } + + ++# Perform tilde (~) completion ++# @return True (0) if completion needs further processing, ++# False (> 0) if tilde is followed by a valid username, completions ++# are put in COMPREPLY and no further processing is necessary. ++_tilde() { ++ local result=0 ++ # Does $1 start with tilde (~) and doesn't contain slash (/)? ++ if [[ ${1:0:1} == "~" && $1 == ${1//\/} ]]; then ++ # Try generate username completions ++ COMPREPLY=( $( compgen -P '~' -u "${1#\~}" ) ) ++ result=${#COMPREPLY[@]} ++ fi ++ return $result ++} ++ ++ + # Expand variable starting with tilde (~) ++# We want to expand ~foo/... to /home/foo/... to avoid problems when ++# word-to-complete starting with a tilde is fed to commands and ending up ++# quoted instead of expanded. + # Only the first portion of the variable from the tilde up to the first slash + # (~../) is expanded. The remainder of the variable, containing for example + # a dollar sign variable ($) or asterisk (*) is not expanded. +diff --git a/test/lib/completions/ls.exp b/test/lib/completions/ls.exp +index 171f6e1..fa47f85 100644 +--- a/test/lib/completions/ls.exp ++++ b/test/lib/completions/ls.exp +@@ -19,4 +19,15 @@ if {[assert_exec {ls --help} "" "" "unsupported"]} { + sync_after_int + + ++set test "~part should complete to ~full" ++assert_bash_exec {compgen -u} {} /@ users ++find_unique_completion_pair $users part full ++# If home directory exists, append slash "/", else space " " ++set trail [expr {[llength [glob -nocomplain ~$full]] ? "/" : " "}] ++assert_complete "~$full$trail" "ls ~$part" $test ++ ++ ++sync_after_int ++ ++ + teardown +diff --git a/test/unit/_tilde.exp b/test/unit/_tilde.exp +new file mode 100644 +index 0000000..54394cb +--- /dev/null ++++ b/test/unit/_tilde.exp +@@ -0,0 +1,51 @@ ++# @param string $part Reference to variable to hold partial unique username ++# @param string $full Reference to variable to hold full unique username ++proc setup {part full} { ++ upvar $part _part ++ upvar $full _full ++ ++ assert_bash_exec {compgen -u} {} /@ users ++ find_unique_completion_pair $users _part _full ++ save_env ++} ++ ++ ++proc teardown {} { ++ assert_env_unmodified { ++ /COMPREPLY=/d ++ } ++} ++ ++ ++setup part full ++ ++ ++set test "function should run without errors" ++assert_bash_exec {_tilde > /dev/null} $test ++ ++ ++sync_after_int ++ ++ ++set test "function should not pollute environment" ++# NOTE: A possible environment pollution is detected by assert_env_modified() in teardown() ++assert_bash_exec {foo() { local aa="~"; _tilde "$aa"; }; foo; unset foo} $test ++ ++ ++sync_after_int ++ ++ ++set test "~full should complete to ~full unmodified" ++set cmd [format {_tilde "~%s"; printf "%%s" "${COMPREPLY[@]}"} $full] ++assert_bash_list "~$full" $cmd $test ++ ++ ++sync_after_int ++ ++ ++set test "~part should complete to ~full" ++set cmd [format {_tilde "~%s"; printf "%%s" "${COMPREPLY[@]}"} $part] ++assert_bash_list "~$full" $cmd $test ++ ++ ++teardown diff --git a/bash-completion.spec b/bash-completion.spec index 5603ec8..a2926fd 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -1,6 +1,9 @@ +# Expected failures in mock, hangs in koji +%bcond_with tests + Name: bash-completion -Version: 1.1 -Release: 7%{?dist} +Version: 1.2 +Release: 3%{?dist} Epoch: 1 Summary: Programmable completion for Bash @@ -9,42 +12,60 @@ License: GPLv2+ URL: http://bash-completion.alioth.debian.org/ Source0: http://bash-completion.alioth.debian.org/files/%{name}-%{version}.tar.bz2 Source1: %{name}-plague-client -# Sources 2 and 3 missing from upstream 1.1 tarball. -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 -Patch1: %{name}-1.1-service.patch +# From upstream post-1.2 git +Patch0: %{name}-1.2-init.d.patch +# From upstream post-1.2 git, #628130 +Patch1: %{name}-1.2-tilde-username-628130.patch +# From upstream post-1.2 git, #630328 +Patch2: %{name}-1.2-rpm-630328.patch +# From upstream post-1.2 git, #630658 +Patch3: %{name}-1.2-known_hosts-ipv6-630658.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -Requires: bash >= 2.05-12 +%if %{with tests} +BuildRequires: dejagnu +BuildRequires: screen +BuildRequires: tcllib +%endif +Requires: bash >= 3.2 # For symlinking in triggers, #490768 Requires: coreutils %description bash-completion is a collection of shell functions that take advantage -of the programmable completion feature of bash 2. +of the programmable completion feature of bash. %prep %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 install -pm 644 %{SOURCE1} contrib/plague-client -install -pm 644 %{SOURCE2} CHANGES -install -pm 644 %{SOURCE3} bash_completion.sh # Updated completions shipped upstream: rm contrib/cowsay -# subversion too, but only in >= 1.6.5-2 -# yum-utils (repomanage) too, but only in >= 1.1.24 -# yum too, but only in >= 3.2.25-2 - -# Combine to per-package files: -( echo ; cat contrib/update-alternatives ) >> contrib/chkconfig -rm contrib/update-alternatives +rm contrib/_modules # environment-modules >= 3.2.7 +%if 0%{?fedora} || 0%{?rhel} > 5 +rm contrib/_mock # mock >= 1.1.1 +rm contrib/_subversion # subversion >= 1.6.5-2 +rm contrib/_yum-utils # yum-utils >= 1.1.24 +rm contrib/_yum # yum >= 3.2.25-2 +%endif + +# Combine to per-package files to work around #585384: +cd contrib +( echo ; cat update-alternatives ) >> chkconfig +rm update-alternatives +( echo ; cat sysctl ) >> procps +rm sysctl +( echo ; cat chsh ; echo ; cat mount ; echo ; cat rtcwake ) >> util-linux +rm chsh mount rtcwake +( echo ; cat xrandr ) >> xhost +mv xhost xorg-x11-server-utils ; rm xrandr +cd .. # Not applicable to Fedora and derivatives: rm contrib/apache2ctl @@ -55,6 +76,7 @@ rm contrib/heimdal rm contrib/kldload rm contrib/lilo rm contrib/links +rm contrib/lintian rm contrib/pkg_install rm contrib/pkgtools rm contrib/portupgrade @@ -67,6 +89,8 @@ rm contrib/p4 %build +%configure +make bash_completion.sh %install @@ -83,7 +107,8 @@ install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d # Always installed (not triggered) completions for practically always # installed packages or non-triggerable common ones: -for f in bash-builtins configure dd getent iconv rpm ; do +for f in bash-builtins configure coreutils dd getent iconv ifupdown \ + module-init-tools rpm service ; do mv $RPM_BUILD_ROOT{%{_datadir}/%{name}/$f,%{_sysconfdir}/bash_completion.d} done @@ -97,6 +122,22 @@ done cd - +%if %{with tests} +%check +# Should be done/fixed upstream +mkdir test/log test/tmp +# For some tests involving non-ASCII filenames +export LANG=en_US.UTF-8 +# This stuff borrowed from dejagnu-1.4.4-17 (tests need a terminal) +tmpfile=$(mktemp) +screen -D -m sh -c '( make check ; echo $? ) >'$tmpfile +cat $tmpfile +result=$(tail -n 1 $tmpfile) +rm -f $tmpfile +exit $result +%endif + + %clean rm -rf $RPM_BUILD_ROOT @@ -112,6 +153,7 @@ rm -rf $RPM_BUILD_ROOT [ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/%1 || :\ %{nil} +%bashcomp_trigger abook %bashcomp_trigger ant %bashcomp_trigger apt %bashcomp_trigger aptitude @@ -120,19 +162,19 @@ rm -rf $RPM_BUILD_ROOT %bashcomp_trigger bind-utils %bashcomp_trigger bitkeeper %bashcomp_trigger bittorrent -%bashcomp_trigger bluez-utils bluez +%bashcomp_trigger bluez %bashcomp_trigger brctl bridge-utils %bashcomp_trigger bzip2 %bashcomp_trigger cfengine %bashcomp_trigger chkconfig -%bashcomp_trigger chsh util-linux-ng,util-linux %bashcomp_trigger cksfv %bashcomp_trigger clisp %bashcomp_trigger cpan2dist perl-CPANPLUS %bashcomp_trigger cpio +%bashcomp_trigger cryptsetup cryptsetup-luks %bashcomp_trigger cups %bashcomp_trigger cvs -%bashcomp_trigger dcop kdelibs3 +%bashcomp_trigger cvsps %bashcomp_trigger dhclient %bashcomp_trigger dict dictd %bashcomp_trigger dpkg @@ -140,6 +182,7 @@ rm -rf $RPM_BUILD_ROOT %bashcomp_trigger dsniff %bashcomp_trigger findutils %bashcomp_trigger freeciv +%bashcomp_trigger fuse %bashcomp_trigger gcc %bashcomp_trigger gcl %bashcomp_trigger gdb @@ -149,13 +192,17 @@ rm -rf $RPM_BUILD_ROOT %bashcomp_trigger gpg gnupg %bashcomp_trigger gpg2 gnupg2 %bashcomp_trigger gzip +%bashcomp_trigger hping2 hping3 %bashcomp_trigger imagemagick ImageMagick %bashcomp_trigger info %bashcomp_trigger ipmitool +%bashcomp_trigger ipsec openswan %bashcomp_trigger iptables +%bashcomp_trigger ipv6calc %bashcomp_trigger isql unixODBC %bashcomp_trigger jar java-1.6.0-openjdk-devel %bashcomp_trigger java java-1.6.0-openjdk +%bashcomp_trigger k3b %bashcomp_trigger ldapvi %bashcomp_trigger lftp %bashcomp_trigger lisp cmucl @@ -168,19 +215,21 @@ rm -rf $RPM_BUILD_ROOT %bashcomp_trigger mc %bashcomp_trigger mcrypt %bashcomp_trigger mdadm +%bashcomp_trigger medusa %bashcomp_trigger minicom %bashcomp_trigger mkinitrd -%bashcomp_trigger mock - -%triggerin -- environment-modules -if [ -e %{_datadir}/Modules/init/bash_completion ] ; then - # Upstream completion in environment-modules >= 3.2.7 - rm -f %{_sysconfdir}/bash_completion.d/modules || : -elif [ ! -e %{_sysconfdir}/bash_completion.d/modules ] ; then - ln -s %{_datadir}/%{name}/modules %{_sysconfdir}/bash_completion.d || : + +%if 0%{?rhel} && 0%{?rhel} < 6 +%triggerin -- mock +if [ -e %{_sysconfdir}/bash_completion.d/mock.bash ] ; then + # Upstream completion in mock >= 1.1.1 + rm -f %{_sysconfdir}/bash_completion.d/_mock || : +elif [ ! -e %{_sysconfdir}/bash_completion.d/_mock ] ; then + ln -s %{_datadir}/%{name}/_mock %{_sysconfdir}/bash_completion.d || : fi -%triggerun -- environment-modules -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/modules || : +%triggerun -- mock +[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/_mock || : +%endif %bashcomp_trigger monodevelop %bashcomp_trigger mplayer @@ -191,6 +240,7 @@ fi %bashcomp_trigger mysqladmin mysql,MySQL-client-community %bashcomp_trigger ncftp %bashcomp_trigger net-tools +%bashcomp_trigger nmap %bashcomp_trigger ntpdate %bashcomp_trigger openldap openldap-clients %bashcomp_trigger openssl @@ -198,26 +248,24 @@ fi %bashcomp_trigger pine %bashcomp_trigger pkg-config pkgconfig %bashcomp_trigger plague-client +%bashcomp_trigger pm-utils %bashcomp_trigger postfix %bashcomp_trigger postgresql %bashcomp_trigger povray +%bashcomp_trigger procps %bashcomp_trigger python -%bashcomp_trigger qdbus qt + +%triggerin -- qt,kdelibs3,kdelibs +[ -e %{_sysconfdir}/bash_completion.d/qdbus ] || \ + ln -s %{_datadir}/%{name}/qdbus %{_sysconfdir}/bash_completion.d || : +%triggerpostun -- qt,kdelibs3,kdelibs +[ $2 -gt 0 ] || [ -x %{_bindir}/dcop ] || [ -x %{_bindir}/qdbus ] || \ + rm -f %{_sysconfdir}/bash_completion.d/qdbus || : + %bashcomp_trigger qemu %bashcomp_trigger quota-tools quota %bashcomp_trigger rcs %bashcomp_trigger rdesktop - -%triggerin -- yum-utils -if [ -e %{_sysconfdir}/bash_completion.d/yum-utils.bash ] ; then - # Upstream completion in yum-utils >= 1.1.24 - rm -f %{_sysconfdir}/bash_completion.d/repomanage || : -elif [ ! -e %{_sysconfdir}/bash_completion.d/repomanage ] ; then - ln -s %{_datadir}/%{name}/repomanage %{_sysconfdir}/bash_completion.d || : -fi -%triggerun -- yum-utils -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/repomanage || : - %bashcomp_trigger resolvconf %bashcomp_trigger rfkill %bashcomp_trigger ri ruby-ri @@ -233,8 +281,10 @@ fi %bashcomp_trigger smartctl smartmontools %bashcomp_trigger snownews %bashcomp_trigger ssh openssh-clients +%bashcomp_trigger sshfs fuse-sshfs %bashcomp_trigger strace +%if 0%{?rhel} && 0%{?rhel} < 6 %triggerin -- subversion if [ -e %{_sysconfdir}/bash_completion.d/subversion ] ; then # Upstream completion in subversion >= 1.6.5-2 @@ -244,27 +294,31 @@ elif [ ! -e %{_sysconfdir}/bash_completion.d/_subversion ] ; then fi %triggerun -- subversion [ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/_subversion || : +%endif %bashcomp_trigger svk perl-SVK -%bashcomp_trigger sysctl procps %bashcomp_trigger tar %bashcomp_trigger tcpdump %bashcomp_trigger unace %bashcomp_trigger unrar +%bashcomp_trigger util-linux util-linux-ng,util-linux %bashcomp_trigger vncviewer tigervnc,vnc %bashcomp_trigger vpnc %bashcomp_trigger wireless-tools %bashcomp_trigger wodim +%bashcomp_trigger wol +%bashcomp_trigger wtf bsd-games %bashcomp_trigger wvdial -%bashcomp_trigger xhost xorg-x11-server-utils %bashcomp_trigger xm xen %bashcomp_trigger xmllint libxml2 %bashcomp_trigger xmlwf expat %bashcomp_trigger xmms -%bashcomp_trigger xrandr xorg-x11-server-utils +%bashcomp_trigger xorg-x11-server-utils +%bashcomp_trigger xsltproc libxslt %bashcomp_trigger xz %bashcomp_trigger yp-tools +%if 0%{?rhel} && 0%{?rhel} < 6 %triggerin -- yum if [ -e %{_sysconfdir}/bash_completion.d/yum.bash ] ; then # Upstream completion in yum >= 3.2.25-2 @@ -275,6 +329,17 @@ fi %triggerun -- yum [ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/_yum || : +%triggerin -- yum-utils +if [ -e %{_sysconfdir}/bash_completion.d/yum-utils.bash ] ; then + # Upstream completion in yum-utils >= 1.1.24 + rm -f %{_sysconfdir}/bash_completion.d/_yum-utils || : +elif [ ! -e %{_sysconfdir}/bash_completion.d/_yum-utils ] ; then + ln -s %{_datadir}/%{name}/_yum-utils %{_sysconfdir}/bash_completion.d || : +fi +%triggerun -- yum-utils +[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/_yum-utils || : +%endif + %bashcomp_trigger yum-arch @@ -286,14 +351,32 @@ fi %dir %{_sysconfdir}/bash_completion.d/ %{_sysconfdir}/bash_completion.d/bash-builtins %{_sysconfdir}/bash_completion.d/configure +%{_sysconfdir}/bash_completion.d/coreutils %{_sysconfdir}/bash_completion.d/dd %{_sysconfdir}/bash_completion.d/getent %{_sysconfdir}/bash_completion.d/iconv +%{_sysconfdir}/bash_completion.d/ifupdown +%{_sysconfdir}/bash_completion.d/module-init-tools %{_sysconfdir}/bash_completion.d/rpm +%{_sysconfdir}/bash_completion.d/service %{_datadir}/%{name}/ %changelog +* Tue Sep 28 2010 Ville Skyttä - 1:1.2-3 +- Apply upstream ~username completion fix for #628130. +- Apply upstream rpm completion improvements for #630328. +- Apply upstream IPv6 address completion fix for #630658. +- Drop some completions that are included in respective upstream packages. +- Fix qdbus/dcop uninstall trigger. + +* Mon Jun 28 2010 Ville Skyttä - 1:1.2-2 +- Apply upstream post 1.2 /etc/init.d/* completion improvements to fix #608351. + +* Wed Jun 16 2010 Ville Skyttä - 1:1.2-1 +- Update to 1.2, all patches applied upstream. +- Fixes #444469, #538433, #541423, and #601813, works around #585384. + * Fri Mar 12 2010 Ville Skyttä - 1:1.1-7 - Autoinstall dpkg and dselect completions. diff --git a/bash_completion.sh b/bash_completion.sh deleted file mode 100644 index 915960b..0000000 --- a/bash_completion.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Check for interactive bash and that we haven't already been sourced. -[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return - -# Check for recent enough version of bash. -bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.} -if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then - if [ -r /etc/bash_completion ]; then - # Source completion code. - . /etc/bash_completion - fi -fi -unset bash bminor bmajor diff --git a/sources b/sources index 8d9c57e..5eb8c96 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -1b5ed247ed904d0a2ec6a6d2c5876c52 bash-completion-1.1.tar.bz2 -7daa098026ae41f6c51a3f03035218f3 CHANGES-1.1 +88c022a98a02a02293716f840eadd884 bash-completion-1.2.tar.bz2