- Add dependency on coreutils for triggers (#490768).
- Update and improve mock completion.
This commit is contained in:
parent
2df5f9f549
commit
e35953bd8c
@ -3,8 +3,6 @@
|
|||||||
#
|
#
|
||||||
# bash completion for mock
|
# bash completion for mock
|
||||||
|
|
||||||
# TODO: --copyin, --copyout
|
|
||||||
|
|
||||||
_mock()
|
_mock()
|
||||||
{
|
{
|
||||||
local cur prev plugins cfgdir
|
local cur prev plugins cfgdir
|
||||||
@ -12,7 +10,7 @@ _mock()
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=`_get_cword`
|
cur=`_get_cword`
|
||||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
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
|
cfgdir=/etc/mock
|
||||||
|
|
||||||
count=0
|
count=0
|
||||||
@ -26,46 +24,54 @@ _mock()
|
|||||||
count=$((++count))
|
count=$((++count))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# --name=value style option
|
||||||
|
if [[ "$cur" == --?*=* ]] ; then
|
||||||
|
prev="${cur/=*}"
|
||||||
|
cur="${cur#$prev=}"
|
||||||
|
fi
|
||||||
|
|
||||||
case $prev in
|
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 | \
|
COMPREPLY=( $( command ls $cfgdir | \
|
||||||
sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') )
|
sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') )
|
||||||
return 0
|
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
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
if [[ "$cur" == -* ]] ; then
|
||||||
COMPREPLY=( $( compgen -W '--version -h --help --rebuild \
|
COMPREPLY=( $( compgen -W '--version -h --help --rebuild \
|
||||||
--shell --chroot --clean --init --installdeps \
|
--buildsrpm --shell --chroot --clean --init \
|
||||||
--install --update --orphanskill -r --root= --offline \
|
--installdeps --install --update --orphanskill \
|
||||||
--no-clean --cleanup-after --no-cleanup-after --arch= \
|
--copyin --copyout -r --root --offline --no-clean \
|
||||||
--target= -D --define= --with= --without= \
|
--cleanup-after --no-cleanup-after --arch --target \
|
||||||
--resultdir= --uniqueext= --configdir= \
|
-D --define --with --without --resultdir --uniqueext \
|
||||||
--rpmbuild_timeout --unpriv --cwd= -v --verbose -q \
|
--configdir --rpmbuild_timeout --unpriv --cwd --spec \
|
||||||
--quiet --trace --enable-plugin= --disable-plugin= \
|
--sources -v --verbose -q --quiet --trace \
|
||||||
--print-root-path' -- $cur ) )
|
--enable-plugin --disable-plugin --print-root-path' \
|
||||||
|
-- $cur ) )
|
||||||
else
|
else
|
||||||
_filedir '?(no)src.rpm'
|
_filedir '?(no)src.rpm'
|
||||||
fi
|
fi
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: bash-completion
|
Name: bash-completion
|
||||||
Version: 20080705
|
Version: 20080705
|
||||||
Release: 3%{?snap:.%{snap}}
|
Release: 4%{?snap:.%{snap}}
|
||||||
Summary: Programmable completion for Bash
|
Summary: Programmable completion for Bash
|
||||||
|
|
||||||
Group: System Environment/Shells
|
Group: System Environment/Shells
|
||||||
@ -21,6 +21,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: bash >= 2.05-12
|
Requires: bash >= 2.05-12
|
||||||
|
# For symlinking in triggers, #490768
|
||||||
|
Requires: coreutils
|
||||||
|
|
||||||
%description
|
%description
|
||||||
bash-completion is a collection of shell functions that take advantage
|
bash-completion is a collection of shell functions that take advantage
|
||||||
@ -263,6 +265,10 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%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
|
* Sun Mar 15 2009 Ville Skyttä <ville.skytta at iki.fi> - 20080705-3.20090314gitf4f0984
|
||||||
- git snapshot f4f0984, fixes #484578 (another issue), #486998.
|
- git snapshot f4f0984, fixes #484578 (another issue), #486998.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user