gcc, lintian, make, pkgadd, slackpkg: grep -> "command grep" (Debian: #734095)

This commit is contained in:
Ville Skyttä 2014-01-06 17:45:48 +02:00
parent 93ee00947a
commit e3edf7ac42
5 changed files with 15 additions and 14 deletions

View File

@ -50,16 +50,16 @@ _gcc()
} && } &&
complete -F _gcc gcc g++ gfortran g77 g95 gcj gpc && complete -F _gcc gcc g++ gfortran g77 g95 gcj gpc &&
{ {
cc --version 2>/dev/null | grep -q GCC || \ cc --version 2>/dev/null | command grep -q GCC || \
[[ $( _realcommand cc ) == *gcc* ]] && \ [[ $( _realcommand cc ) == *gcc* ]] && \
complete -F _gcc cc || complete -F _minimal cc complete -F _gcc cc || complete -F _minimal cc
c++ --version 2>/dev/null | grep -q GCC || \ c++ --version 2>/dev/null | command grep -q GCC || \
[[ $( _realcommand c++ ) == *g++* ]] && \ [[ $( _realcommand c++ ) == *g++* ]] && \
complete -F _gcc c++ || complete -F _minimal c++ complete -F _gcc c++ || complete -F _minimal c++
f77 --version 2>/dev/null | grep -q GCC || \ f77 --version 2>/dev/null | command grep -q GCC || \
[[ $( _realcommand f77 ) == *gfortran* ]] && \ [[ $( _realcommand f77 ) == *gfortran* ]] && \
complete -F _gcc f77 || complete -F _minimal f77 complete -F _gcc f77 || complete -F _minimal f77
f95 --version 2>/dev/null | grep -q GCC || \ f95 --version 2>/dev/null | command grep -q GCC || \
[[ $( _realcommand f95 ) == *gfortran* ]] && \ [[ $( _realcommand f95 ) == *gfortran* ]] && \
complete -F _gcc f95 || complete -F _minimal f95 complete -F _gcc f95 || complete -F _minimal f95
} }

View File

@ -8,8 +8,8 @@ _lintian_tags()
if [[ "$cur" == *, ]]; then if [[ "$cur" == *, ]]; then
search=${cur//,/ } search=${cur//,/ }
for item in $search; do for item in $search; do
match=$(grep -nE "^Tag: $item$" /usr/share/lintian/checks/*.desc \ match=$( command grep -nE "^Tag: $item$" \
| cut -d: -f1 ) /usr/share/lintian/checks/*.desc | cut -d: -f1 )
tags=$( sed -e "s/\<$item\>//g" <<<$tags ) tags=$( sed -e "s/\<$item\>//g" <<<$tags )
done done
COMPREPLY+=( $(compgen -W "$tags") ) COMPREPLY+=( $(compgen -W "$tags") )
@ -30,8 +30,8 @@ _lintian_checks()
if [[ "$cur" == *, ]]; then if [[ "$cur" == *, ]]; then
search=${cur//,/ } search=${cur//,/ }
for item in $search; do for item in $search; do
match=$(grep -nE "^(Check-Script|Abbrev): $item$" \ match=$( command grep -nE "^(Check-Script|Abbrev): $item$" \
/usr/share/lintian/checks/*.desc | cut -d: -f1 ) /usr/share/lintian/checks/*.desc | cut -d: -f1 )
todisable=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' $match ) todisable=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' $match )
for name in $todisable; do for name in $todisable; do
checks=$( sed -e "s/\<$name\>//g" <<<$checks ) checks=$( sed -e "s/\<$name\>//g" <<<$checks )
@ -55,8 +55,8 @@ _lintian_infos()
if [[ "$cur" == *, ]]; then if [[ "$cur" == *, ]]; then
search=${cur//,/ } search=${cur//,/ }
for item in $search; do for item in $search; do
match=$( grep -nE "^Collector: $item$" \ match=$( command grep -nE "^Collector: $item$" \
/usr/share/lintian/collection/*.desc | cut -d: -f1 ) /usr/share/lintian/collection/*.desc | cut -d: -f1 )
infos=$( sed -e "s/\<$item\>//g" <<<$infos ) infos=$( sed -e "s/\<$item\>//g" <<<$infos )
done done
COMPREPLY+=( $(compgen -W "$infos") ) COMPREPLY+=( $(compgen -W "$infos") )

View File

@ -142,7 +142,7 @@ _make()
mode=-d # display-only mode mode=-d # display-only mode
fi fi
local reset=$( set +o | grep -F posix ); set +o posix # for <(...) local reset=$( set +o | command grep -F posix ); set +o posix # <(...)
COMPREPLY=( $( LC_ALL=C \ COMPREPLY=( $( LC_ALL=C \
make -npq "${makef[@]}" "${makef_dir[@]}" .DEFAULT 2>/dev/null | \ make -npq "${makef[@]}" "${makef_dir[@]}" .DEFAULT 2>/dev/null | \
sed -nf <(_make_target_extract_script $mode "$cur") ) ) sed -nf <(_make_target_extract_script $mode "$cur") ) )

View File

@ -48,7 +48,8 @@ _pkgadd ()
done done
pkginst_list="${pkginst_list[@]}" pkginst_list="${pkginst_list[@]}"
else else
pkginst_list=$(strings $(dequote $device) | grep "^PKG=" | sort -u | cut -d= -f2) pkginst_list=$(strings $(dequote $device) | \
command grep "^PKG=" | sort -u | cut -d= -f2)
fi fi
COMPREPLY=( $(compgen -W "$pkginst_list" -- ${cur}) ) COMPREPLY=( $(compgen -W "$pkginst_list" -- ${cur}) )
fi fi

View File

@ -79,12 +79,12 @@ _slackpkg()
COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x
xap xfce y' -- "$cur" ) ) xap xfce y' -- "$cur" ) )
COMPREPLY+=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ COMPREPLY+=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \
grep "^$cur" ) ) command grep "^$cur" ) )
return return
;; ;;
info) info)
COMPREPLY=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ COMPREPLY=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \
grep "^$cur" ) ) command grep "^$cur" ) )
return return
;; ;;
update) update)