- Work around potential login problem in profile.d snippet (#174355).

Sat Nov 26 2005 Ville Skyttä <ville.skytta at iki.fi>
- Don't mark the main source file as %config.
- Make profile.d snippet non-executable (#35714) and noreplace.
- Add mock, plague-client and repomanage completion.
- Allow "cvs stat" completion.
- Macroize trigger creation.
This commit is contained in:
Ville Skyttä 2005-11-28 20:26:32 +00:00
parent 238fd1a174
commit 192263e892
6 changed files with 140 additions and 76 deletions

View File

@ -0,0 +1,20 @@
--- bash_completion~ 2005-07-21 22:21:22.000000000 +0300
+++ bash_completion 2005-09-21 17:25:01.000000000 +0300
@@ -1544,7 +1544,7 @@
@(rtag|rfreeze))
mode=rtag
;;
- st?(atus))
+ st?(at?(us)))
mode=status
;;
@(tag|freeze))
@@ -1697,7 +1697,7 @@
commit diff delete edit export \
freeze get history import log new \
patch rcs rdiff release remove \
- rfreeze rlog rm rtag status tag \
+ rfreeze rlog rm rtag stat status tag \
unedit up update -H -Q -q -b -d -e \
-f -l -n -t -r -v -w -x -z --help \
--version' -- $cur ) )

33
bash-completion-mock Normal file
View File

@ -0,0 +1,33 @@
# bash completion for mock -*- sh -*-
_mock()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
--@(result|state)dir)
_filedir -d
return 0
;;
-r)
COMPREPLY=( $( command ls /etc/mock | \
sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') )
return 0
;;
-@(-arch|-uniqueext|-help|h))
return 0
;;
esac
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '--version -h --help -r --no-clean --arch \
--debug --resultdir --statedir --uniqueext' -- $cur ) )
else
_filedir '?(no)src.rpm'
fi
}
complete -F _mock $filenames mock

View File

@ -0,0 +1,16 @@
# bash completion for plague-client -*- sh -*-
_plague_client()
{
local cur
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
[ $COMP_CWORD = 1 ] && \
COMPREPLY=( $( compgen -W 'build detail finish help is_paused kill list \
list_builders pause requeue unpause update_builders' -- $cur ) )
return 0
}
complete -F _plague_client plague-client

View File

@ -0,0 +1,24 @@
# bash completion for repomanage -*- sh -*-
_repomanage()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
-@(h|-help|k|-keep))
return 0
;;
esac
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '-o --old -n --new -s --space -k --keep \
-c --nocheck -h --help' -- $cur ) )
else
_filedir -d
fi
}
complete -F _repomanage repomanage

View File

@ -1,5 +1,5 @@
# check for bash # check for bash (and that we haven't already been sourced, see eg. #174355)
[ -z "$BASH_VERSION" ] && return [ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return
# check for correct version of bash # check for correct version of bash
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.} bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}

View File

@ -1,6 +1,6 @@
Name: bash-completion Name: bash-completion
Version: 20050721 Version: 20050721
Release: 1%{?dist} Release: 2%{?dist}
Summary: Programmable completion for Bash Summary: Programmable completion for Bash
Group: System Environment/Shells Group: System Environment/Shells
@ -8,6 +8,10 @@ License: GPL
URL: http://www.caliban.org/bash/ URL: http://www.caliban.org/bash/
Source0: http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2 Source0: http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
Source1: %{name}.profile Source1: %{name}.profile
Source2: %{name}-mock
Source3: %{name}-repomanage
Source4: %{name}-plague-client
Patch0: %{name}-20050721-cvs-stat.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
@ -20,6 +24,10 @@ of the programmable completion feature of bash 2.
%prep %prep
%setup -q -n bash_completion %setup -q -n bash_completion
%patch0
install -pm 644 %{SOURCE2} contrib/mock
install -pm 644 %{SOURCE3} contrib/plague-client
install -pm 644 %{SOURCE3} contrib/repomanage
%build %build
@ -46,87 +54,50 @@ cd -
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%triggerin -- bittorrent %define bashcomp_trigger() \
if [ ! -e %{_sysconfdir}/bash_completion.d/bittorrent ] ; then %triggerin -- %1\
ln -s %{_datadir}/%{name}/bittorrent %{_sysconfdir}/bash_completion.d if [ ! -e %{_sysconfdir}/bash_completion.d/%{?2}%{!?2:%1} ] ; then\
fi ln -s %{_datadir}/%{name}/%{?2}%{!?2:%1} %{_sysconfdir}/bash_completion.d\
%triggerun -- bittorrent fi\
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/bittorrent %triggerun -- %1\
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/%{?2}%{!?2:%1}\
%{nil}
%triggerin -- cksfv %bashcomp_trigger bittorrent
if [ ! -e %{_sysconfdir}/bash_completion.d/cksfv ] ; then %bashcomp_trigger cksfv
ln -s %{_datadir}/%{name}/cksfv %{_sysconfdir}/bash_completion.d %bashcomp_trigger freeciv
fi %bashcomp_trigger gkrellm
%triggerun -- cksfv %bashcomp_trigger mailman
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/cksfv %bashcomp_trigger mcrypt
%bashcomp_trigger mock
%triggerin -- freeciv %bashcomp_trigger mtx
if [ ! -e %{_sysconfdir}/bash_completion.d/freeciv ] ; then %bashcomp_trigger plague-client
ln -s %{_datadir}/%{name}/freeciv %{_sysconfdir}/bash_completion.d %bashcomp_trigger subversion
fi %bashcomp_trigger unace
%triggerun -- freeciv %bashcomp_trigger unrar
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/freeciv %bashcomp_trigger yum-utils repomanage
%triggerin -- gkrellm
if [ ! -e %{_sysconfdir}/bash_completion.d/gkrellm ] ; then
ln -s %{_datadir}/%{name}/gkrellm %{_sysconfdir}/bash_completion.d
fi
%triggerun -- gkrellm
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/gkrellm
%triggerin -- mailman
if [ ! -e %{_sysconfdir}/bash_completion.d/mailman ] ; then
ln -s %{_datadir}/%{name}/mailman %{_sysconfdir}/bash_completion.d
fi
%triggerun -- mailman
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mailman
%triggerin -- mcrypt
if [ ! -e %{_sysconfdir}/bash_completion.d/mcrypt ] ; then
ln -s %{_datadir}/%{name}/mcrypt %{_sysconfdir}/bash_completion.d
fi
%triggerun -- mcrypt
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mcrypt
%triggerin -- mtx
if [ ! -e %{_sysconfdir}/bash_completion.d/mtx ] ; then
ln -s %{_datadir}/%{name}/mtx %{_sysconfdir}/bash_completion.d
fi
%triggerun -- mtx
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mtx
%triggerin -- subversion
if [ ! -e %{_sysconfdir}/bash_completion.d/subversion ] ; then
ln -s %{_datadir}/%{name}/subversion %{_sysconfdir}/bash_completion.d
fi
%triggerun -- subversion
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/subversion
%triggerin -- unace
if [ ! -e %{_sysconfdir}/bash_completion.d/unace ] ; then
ln -s %{_datadir}/%{name}/unace %{_sysconfdir}/bash_completion.d
fi
%triggerun -- unace
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/unace
%triggerin -- unrar
if [ ! -e %{_sysconfdir}/bash_completion.d/unrar ] ; then
ln -s %{_datadir}/%{name}/unrar %{_sysconfdir}/bash_completion.d
fi
%triggerun -- unrar
[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/unrar
%files -f %{name}-ghosts.list %files -f %{name}-ghosts.list
%defattr(0644,root,root,0755) %defattr(-,root,root,-)
%doc BUGS Changelog COPYING README %doc BUGS Changelog COPYING README
%config %{_sysconfdir}/bash_completion %config(noreplace) %{_sysconfdir}/profile.d/bash_completion.sh
%attr(0755,root,root) %config %{_sysconfdir}/profile.d/* %{_sysconfdir}/bash_completion
%{_datadir}/%{name} %dir %{_sysconfdir}/bash_completion.d/
%dir %{_sysconfdir}/bash_completion.d %{_datadir}/%{name}/
%changelog %changelog
* Mon Nov 28 2005 Ville Skyttä <ville.skytta at iki.fi> - 20050721-2
- Work around potential login problem in profile.d snippet (#174355).
* Sat Nov 26 2005 Ville Skyttä <ville.skytta at iki.fi>
- Don't mark the main source file as %%config.
- Make profile.d snippet non-executable (#35714) and noreplace.
- Add mock, plague-client and repomanage completion.
- Allow "cvs stat" completion.
- Macroize trigger creation.
* Fri Jul 22 2005 Ville Skyttä <ville.skytta at iki.fi> - 20050721-1 * Fri Jul 22 2005 Ville Skyttä <ville.skytta at iki.fi> - 20050721-1
- 20050721. - 20050721.