Update to 1.3.
This commit is contained in:
parent
2ec49de034
commit
9793c230a0
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
bash-completion-1.2.tar.bz2
|
||||
/CHANGES.package.old
|
||||
/bash-completion-1.3.tar.bz2
|
||||
|
@ -1,19 +0,0 @@
|
||||
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
|
@ -1,37 +0,0 @@
|
||||
--- a/bash_completion
|
||||
+++ b/bash_completion
|
||||
@@ -1259,16 +1259,16 @@ _known_hosts_real()
|
||||
awkcur=${awkcur//\./\\\.}
|
||||
curd=$awkcur
|
||||
|
||||
- if [[ "$awkcur" == [0-9]*.* ]]; then
|
||||
- # Digits followed by a dot - just search for that
|
||||
- awkcur="^$awkcur.*"
|
||||
+ if [[ "$awkcur" == [0-9]*[.:]* ]]; then
|
||||
+ # Digits followed by a dot or a colon - just search for that
|
||||
+ awkcur="^$awkcur[.:]*"
|
||||
elif [[ "$awkcur" == [0-9]* ]]; then
|
||||
- # Digits followed by no dot - search for digits followed
|
||||
- # by a dot
|
||||
- awkcur="^$awkcur.*\."
|
||||
+ # Digits followed by no dot or colon - search for digits followed
|
||||
+ # by a dot or a colon
|
||||
+ awkcur="^$awkcur.*[.:]"
|
||||
elif [ -z "$awkcur" ]; then
|
||||
- # A blank - search for a dot or an alpha character
|
||||
- awkcur="[a-z.]"
|
||||
+ # A blank - search for a dot, a colon, or an alpha character
|
||||
+ awkcur="[a-z.:]"
|
||||
else
|
||||
awkcur="^$awkcur"
|
||||
fi
|
||||
@@ -1278,8 +1278,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
|
@ -1,78 +0,0 @@
|
||||
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"
|
@ -1,117 +0,0 @@
|
||||
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
|
29
bash-completion-1.3-gendiff.patch
Normal file
29
bash-completion-1.3-gendiff.patch
Normal file
@ -0,0 +1,29 @@
|
||||
commit d066ace4cbca7f5da611f0fee2497e24e9d84f67
|
||||
Author: Ville Skyttä <ville.skytta@iki.fi>
|
||||
Date: Mon Feb 7 20:59:01 2011 +0200
|
||||
|
||||
Do file completion after gendiff output redirection.
|
||||
|
||||
Common use case is "gendiff DIR EXTENSION > FILE".
|
||||
|
||||
diff --git a/completions/rpm b/completions/rpm
|
||||
index bbab036..5838365 100644
|
||||
--- a/completions/rpm
|
||||
+++ b/completions/rpm
|
||||
@@ -294,9 +294,13 @@ have gendiff &&
|
||||
_gendiff()
|
||||
{
|
||||
COMPREPLY=()
|
||||
- local cur cword
|
||||
- _get_comp_words_by_ref cur cword
|
||||
- [[ $cword != 1 ]] || _filedir -d
|
||||
+ local cur prev cword
|
||||
+ _get_comp_words_by_ref cur prev cword
|
||||
+ if [[ $cword -eq 1 ]]; then
|
||||
+ _filedir -d
|
||||
+ elif [[ $prev == *\> ]]; then
|
||||
+ _filedir
|
||||
+ fi
|
||||
} &&
|
||||
complete -F _gendiff gendiff
|
||||
|
19
bash-completion-1.3-helpersdir.patch
Normal file
19
bash-completion-1.3-helpersdir.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff -up bash-completion-1.3/completions/perl~ bash-completion-1.3/completions/perl
|
||||
--- bash-completion-1.3/completions/perl~ 2011-01-21 11:36:11.000000000 +0200
|
||||
+++ bash-completion-1.3/completions/perl 2011-02-07 21:24:10.050008940 +0200
|
||||
@@ -4,13 +4,13 @@ have perl &&
|
||||
{
|
||||
_perlmodules()
|
||||
{
|
||||
- COMPREPLY=( $( compgen -P "$prefix" -W "$( $1 ${BASH_SOURCE[0]%/*}/helpers/perl modules $cur )" -- "$cur" ) )
|
||||
+ COMPREPLY=( $( compgen -P "$prefix" -W "$( $1 $(dirname $(readlink -f ${BASH_SOURCE[0]}))/helpers/perl modules $cur )" -- "$cur" ) )
|
||||
__ltrim_colon_completions "$prefix$cur"
|
||||
}
|
||||
|
||||
_perlfunctions()
|
||||
{
|
||||
- COMPREPLY=( $( compgen -P "$prefix" -W "$( ${BASH_SOURCE[0]%/*}/helpers/perl functions $cur )" -- "$cur" ) )
|
||||
+ COMPREPLY=( $( compgen -P "$prefix" -W "$( $(dirname $(readlink -f ${BASH_SOURCE[0]}))/helpers/perl functions $cur )" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_perl()
|
@ -8,7 +8,7 @@ _plague_client()
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
[ $COMP_CWORD = 1 ] && \
|
||||
COMPREPLY=( $( compgen -W 'build detail finish help is_paused \
|
||||
@ -16,5 +16,5 @@ _plague_client()
|
||||
update_builders' -- $cur ) )
|
||||
|
||||
return 0
|
||||
}
|
||||
} &&
|
||||
complete -F _plague_client plague-client
|
||||
|
@ -2,8 +2,8 @@
|
||||
%bcond_with tests
|
||||
|
||||
Name: bash-completion
|
||||
Version: 1.2
|
||||
Release: 5%{?dist}
|
||||
Version: 1.3
|
||||
Release: 1%{?dist}
|
||||
Epoch: 1
|
||||
Summary: Programmable completion for Bash
|
||||
|
||||
@ -13,14 +13,10 @@ URL: http://bash-completion.alioth.debian.org/
|
||||
Source0: http://bash-completion.alioth.debian.org/files/%{name}-%{version}.tar.bz2
|
||||
Source1: %{name}-plague-client
|
||||
Source2: CHANGES.package.old
|
||||
# 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
|
||||
# Non-upstream: adjust helpers dir location to our modified layout
|
||||
Patch0: %{name}-1.3-helpersdir.patch
|
||||
# From upstream post 1.3 git
|
||||
Patch1: %{name}-1.3-gendiff.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildArch: noarch
|
||||
@ -42,92 +38,89 @@ of the programmable completion feature of bash.
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
install -pm 644 %{SOURCE1} contrib/plague-client
|
||||
install -pm 644 %{SOURCE2} .
|
||||
|
||||
|
||||
%build
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT %{name}-files.list
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
cd $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
|
||||
|
||||
# Updated completions shipped upstream:
|
||||
rm contrib/cowsay
|
||||
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
|
||||
rm cowsay
|
||||
|
||||
# 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 ..
|
||||
( echo ; cat xmodmap ; echo ; cat xrandr ; echo ; cat xrdb ) >> xhost
|
||||
mv xhost xorg-x11-server-utils ; rm xmodmap xrandr xrdb
|
||||
|
||||
# Not applicable to Fedora and derivatives:
|
||||
rm contrib/apache2ctl
|
||||
rm contrib/apt-build
|
||||
rm contrib/aptitude
|
||||
rm contrib/cardctl
|
||||
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
|
||||
rm contrib/reportbug
|
||||
rm contrib/sysv-rc
|
||||
rm apache2ctl
|
||||
rm apt-build
|
||||
rm aptitude
|
||||
rm cardctl
|
||||
rm heimdal
|
||||
rm kldload
|
||||
rm lilo
|
||||
rm links
|
||||
rm lintian
|
||||
rm pkg_install
|
||||
rm pkgtools
|
||||
rm portupgrade
|
||||
rm reportbug
|
||||
rm sysv-rc
|
||||
|
||||
# Not handled due to other reasons (e.g. no known packages) (yet?):
|
||||
rm contrib/larch
|
||||
rm contrib/p4
|
||||
|
||||
|
||||
%build
|
||||
%configure
|
||||
make bash_completion.sh
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT %{name}-ghosts.list
|
||||
|
||||
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
|
||||
install -pm 644 bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
install -pm 644 bash_completion.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
|
||||
rm larch
|
||||
rm p4
|
||||
|
||||
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
install -pm 644 contrib/* $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
|
||||
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
|
||||
mv * $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/plague-client
|
||||
|
||||
# Always installed (not triggered) completions for practically always
|
||||
# installed packages or non-triggerable common ones:
|
||||
for f in bash-builtins configure coreutils dd getent iconv ifupdown \
|
||||
module-init-tools rpm service util-linux ; do
|
||||
mv $RPM_BUILD_ROOT{%{_datadir}/%{name}/$f,%{_sysconfdir}/bash_completion.d}
|
||||
module-init-tools rpm service sh util-linux ; do
|
||||
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/$f .
|
||||
done
|
||||
|
||||
d=$(pwd)
|
||||
# ghost list
|
||||
cd - # $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
|
||||
|
||||
%if 0%{?rhel} == 5
|
||||
# mock >= 1.1.1, subversion >= 1.6.5-2, yum-utils >= 1.1.24, yum >= 3.2.25-2
|
||||
install -pm 644 completions/_{mock,subversion,yum-utils,yum} \
|
||||
$RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%endif
|
||||
|
||||
# file list
|
||||
filelist=$(pwd)/%{name}-files.list
|
||||
cd $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
for f in * ; do
|
||||
[ $f = helpers ] && continue
|
||||
ln -s %{_datadir}/%{name}/$f $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
|
||||
echo "%ghost %{_sysconfdir}/bash_completion.d/$f" >> $d/%{name}-ghosts.list
|
||||
echo "%ghost %{_sysconfdir}/bash_completion.d/$f" >> $filelist
|
||||
echo "%{_datadir}/%{name}/$f" >> $filelist
|
||||
done
|
||||
cd -
|
||||
cd - # $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
|
||||
# avoid dependency on perl (will only be invoked if perl is installed)
|
||||
chmod -x $RPM_BUILD_ROOT%{_datadir}/%{name}/helpers/perl
|
||||
|
||||
|
||||
%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)
|
||||
@ -161,6 +154,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%bashcomp_trigger apt
|
||||
%bashcomp_trigger aptitude
|
||||
%bashcomp_trigger aspell
|
||||
%bashcomp_trigger autoconf
|
||||
%bashcomp_trigger automake
|
||||
%bashcomp_trigger autorpm
|
||||
%bashcomp_trigger bind-utils
|
||||
%bashcomp_trigger bitkeeper
|
||||
@ -174,6 +169,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%bashcomp_trigger clisp
|
||||
%bashcomp_trigger cpan2dist perl-CPANPLUS
|
||||
%bashcomp_trigger cpio
|
||||
%bashcomp_trigger crontab cronie,vixie-cron %{_bindir}/crontab
|
||||
%bashcomp_trigger cryptsetup cryptsetup-luks
|
||||
%bashcomp_trigger cups
|
||||
%bashcomp_trigger cvs
|
||||
@ -183,8 +179,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%bashcomp_trigger dpkg
|
||||
%bashcomp_trigger dselect
|
||||
%bashcomp_trigger dsniff
|
||||
%bashcomp_trigger dvd+rw-tools
|
||||
%bashcomp_trigger e2fsprogs
|
||||
%bashcomp_trigger findutils
|
||||
%bashcomp_trigger freeciv
|
||||
%bashcomp_trigger freerdp
|
||||
%bashcomp_trigger fuse
|
||||
%bashcomp_trigger gcc
|
||||
%bashcomp_trigger gcl
|
||||
@ -197,8 +196,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%bashcomp_trigger gzip
|
||||
%bashcomp_trigger hping2 hping3
|
||||
%bashcomp_trigger imagemagick ImageMagick
|
||||
%bashcomp_trigger iftop
|
||||
%bashcomp_trigger info
|
||||
%bashcomp_trigger ipmitool
|
||||
%bashcomp_trigger iproute2 iproute
|
||||
%bashcomp_trigger ipsec openswan
|
||||
%bashcomp_trigger iptables
|
||||
%bashcomp_trigger ipv6calc
|
||||
@ -209,6 +210,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%bashcomp_trigger ldapvi
|
||||
%bashcomp_trigger lftp
|
||||
%bashcomp_trigger lisp cmucl
|
||||
%bashcomp_trigger lrzip
|
||||
%bashcomp_trigger lsof
|
||||
%bashcomp_trigger lvm lvm2
|
||||
%bashcomp_trigger lzma xz-lzma-compat
|
||||
%bashcomp_trigger lzop
|
||||
@ -222,7 +225,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%bashcomp_trigger minicom
|
||||
%bashcomp_trigger mkinitrd
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} < 6
|
||||
%if 0%{?rhel} == 5
|
||||
%triggerin -- mock
|
||||
if [ -e %{_sysconfdir}/bash_completion.d/mock.bash ] ; then
|
||||
# Upstream completion in mock >= 1.1.1
|
||||
@ -245,6 +248,7 @@ fi
|
||||
%bashcomp_trigger net-tools
|
||||
%bashcomp_trigger nmap
|
||||
%bashcomp_trigger ntpdate
|
||||
%bashcomp_trigger open-iscsi iscsi-initiator-utils
|
||||
%bashcomp_trigger openldap openldap-clients
|
||||
%bashcomp_trigger openssl
|
||||
%bashcomp_trigger perl
|
||||
@ -276,11 +280,12 @@ fi
|
||||
%bashcomp_trigger sitecopy
|
||||
%bashcomp_trigger smartctl smartmontools
|
||||
%bashcomp_trigger snownews
|
||||
%bashcomp_trigger sqlite3 sqlite
|
||||
%bashcomp_trigger ssh openssh-clients
|
||||
%bashcomp_trigger sshfs fuse-sshfs
|
||||
%bashcomp_trigger strace
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} < 6
|
||||
%if 0%{?rhel} == 5
|
||||
%triggerin -- subversion
|
||||
if [ -e %{_sysconfdir}/bash_completion.d/subversion ] ; then
|
||||
# Upstream completion in subversion >= 1.6.5-2
|
||||
@ -293,6 +298,7 @@ fi
|
||||
%endif
|
||||
|
||||
%bashcomp_trigger svk perl-SVK
|
||||
%bashcomp_trigger sysbench
|
||||
%bashcomp_trigger tar
|
||||
%bashcomp_trigger tcpdump
|
||||
%bashcomp_trigger unace
|
||||
@ -313,7 +319,7 @@ fi
|
||||
%bashcomp_trigger xz
|
||||
%bashcomp_trigger yp-tools
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} < 6
|
||||
%if 0%{?rhel} == 5
|
||||
%triggerin -- yum
|
||||
if [ -e %{_sysconfdir}/bash_completion.d/yum.bash ] ; then
|
||||
# Upstream completion in yum >= 3.2.25-2
|
||||
@ -338,7 +344,7 @@ fi
|
||||
%bashcomp_trigger yum-arch
|
||||
|
||||
|
||||
%files -f %{name}-ghosts.list
|
||||
%files -f %{name}-files.list
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS CHANGES CHANGES.package.old COPYING README TODO
|
||||
%config(noreplace) %{_sysconfdir}/profile.d/bash_completion.sh
|
||||
@ -354,11 +360,17 @@ fi
|
||||
%{_sysconfdir}/bash_completion.d/module-init-tools
|
||||
%{_sysconfdir}/bash_completion.d/rpm
|
||||
%{_sysconfdir}/bash_completion.d/service
|
||||
%{_sysconfdir}/bash_completion.d/sh
|
||||
%{_sysconfdir}/bash_completion.d/util-linux
|
||||
%{_datadir}/%{name}/
|
||||
%dir %{_datadir}/%{name}/
|
||||
%dir %{_datadir}/%{name}/helpers/
|
||||
%attr(755,root,root) %{_datadir}/%{name}/helpers/perl
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Feb 7 2011 Ville Skyttä <ville.skytta@iki.fi> - 1:1.3-1
|
||||
- Update to 1.3.
|
||||
|
||||
* Wed Oct 13 2010 Ville Skyttä <ville.skytta@iki.fi> - 1:1.2-5
|
||||
- Install util-linux completions unconditionally.
|
||||
- Make trigger target package rename etc tracking easier to maintain, and
|
||||
|
Loading…
Reference in New Issue
Block a user