- Add dependency on coreutils for triggers (#490768).

- Update and improve mock completion.
This commit is contained in:
Ville Skyttä 2009-03-23 19:14:45 +00:00
parent 2df5f9f549
commit e35953bd8c
2 changed files with 45 additions and 33 deletions

View File

@ -3,8 +3,6 @@
#
# bash completion for mock
# TODO: --copyin, --copyout
_mock()
{
local cur prev plugins cfgdir
@ -12,7 +10,7 @@ _mock()
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
plugins='ccache yum_cache root_cache bind_mount'
plugins='tmpfs root_cache yum_cache bind_mount ccache'
cfgdir=/etc/mock
count=0
@ -26,46 +24,54 @@ _mock()
count=$((++count))
done
# --name=value style option
if [[ "$cur" == --?*=* ]] ; then
prev="${cur/=*}"
cur="${cur#$prev=}"
fi
case $prev in
-@(-root|r))
-@(h|-help|-copy@(in|out)|-arch|D|-define|-with?(out)|-uniqueext|-rpmbuild_timeout|-sources|-cwd))
return 0
;;
-@(r|-root))
COMPREPLY=( $( command ls $cfgdir | \
sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') )
return 0
;;
-@(-help|h))
--@(config|result)dir)
_filedir -d
return 0
;;
--spec)
_filedir spec
return 0
;;
--target)
# Yep, compatible archs, not compatible build archs
# (e.g. ix86 chroot builds in x86_64 mock host)
# This would actually depend on what the target root
# can be used to build for...
COMPREPLY=( $( compgen -W "$( command rpm --showrc | sed -ne 's/^\s*compatible\s\+archs\s*:\s*\(.*\)/\1/i p' )" -- $cur ) )
return 0
;;
--@(en|dis)able-plugin)
COMPREPLY=( $( compgen -W "$plugins" -- $cur ) )
return 0
;;
esac
# --name=value style option
if [[ "$cur" == *=* ]] ; then
prev=${cur/=*/}
cur=${cur/*=/}
case $prev in
--@(config|result)dir)
_filedir -d
return 0
;;
--@(en|dis)able-plugin)
COMPREPLY=( $( compgen -W "$plugins" -- $cur ) )
return 0
;;
--@(arch|target|define|with|without|uniqueext|rpmbuild_timeout|cwd))
return 0
;;
esac
fi
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '--version -h --help --rebuild \
--shell --chroot --clean --init --installdeps \
--install --update --orphanskill -r --root= --offline \
--no-clean --cleanup-after --no-cleanup-after --arch= \
--target= -D --define= --with= --without= \
--resultdir= --uniqueext= --configdir= \
--rpmbuild_timeout --unpriv --cwd= -v --verbose -q \
--quiet --trace --enable-plugin= --disable-plugin= \
--print-root-path' -- $cur ) )
--buildsrpm --shell --chroot --clean --init \
--installdeps --install --update --orphanskill \
--copyin --copyout -r --root --offline --no-clean \
--cleanup-after --no-cleanup-after --arch --target \
-D --define --with --without --resultdir --uniqueext \
--configdir --rpmbuild_timeout --unpriv --cwd --spec \
--sources -v --verbose -q --quiet --trace \
--enable-plugin --disable-plugin --print-root-path' \
-- $cur ) )
else
_filedir '?(no)src.rpm'
fi

View File

@ -2,7 +2,7 @@
Name: bash-completion
Version: 20080705
Release: 3%{?snap:.%{snap}}
Release: 4%{?snap:.%{snap}}
Summary: Programmable completion for Bash
Group: System Environment/Shells
@ -21,6 +21,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: bash >= 2.05-12
# For symlinking in triggers, #490768
Requires: coreutils
%description
bash-completion is a collection of shell functions that take advantage
@ -263,6 +265,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Mar 23 2009 Ville Skyttä <ville.skytta at iki.fi> - 20080705-4.20090314gitf4f0984
- Add dependency on coreutils for triggers (#490768).
- Update and improve mock completion.
* Sun Mar 15 2009 Ville Skyttä <ville.skytta at iki.fi> - 20080705-3.20090314gitf4f0984
- git snapshot f4f0984, fixes #484578 (another issue), #486998.