- remove some dependence on grep-dctrl in Debian-specific completion

functions
- don't split ksh style globs over more than one line, since this doesn't seem
  to work
both of the above fixes supplied by Dr.Rafael Sepúlveda <drs@gnulinux.org.mx>
This commit is contained in:
ianmacd 2002-05-19 07:16:30 +00:00
parent 89839485ee
commit 5d5f9b5608

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05a # bash_completion - some programmable completion functions for bash 2.05a
# #
# $Id: bash_completion,v 1.326 2002/05/18 23:00:14 ianmacd Exp $ # $Id: bash_completion,v 1.327 2002/05/19 09:16:30 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -1427,8 +1427,8 @@ complete -F _apt_cache $filenames apt-cache
have aptitude && { have aptitude && {
_comp-dpkg-hold-packages() _comp-dpkg-hold-packages()
{ {
grep-dctrl -r -P -s package,status "^$1" /var/lib/dpkg/status \ grep -B 2 'hold' /var/lib/dpkg/status | grep 'Package' \
| grep-dctrl -n -F status -s package 'hold' | cut -d\ -f2
} }
_aptitude() _aptitude()
@ -1446,9 +1446,7 @@ _aptitude()
--with-suggests --without-recommends --without-suggests' --with-suggests --without-recommends --without-suggests'
for (( i=0; i < ${#COMP_WORDS}-1; i++ )); do for (( i=0; i < ${#COMP_WORDS}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @(install|hold|unhold|markauto| \ if [[ ${COMP_WORDS[i]} == @(install|hold|unhold|markauto|unmarkauto|dist-upgrade|download|purge|remove) ]]; then
unmarkauto|dist-upgrade|download| \
purge|remove) ]]; then
special=${COMP_WORDS[i]} special=${COMP_WORDS[i]}
fi fi
#exclude some mutually exclusive options #exclude some mutually exclusive options
@ -1474,8 +1472,8 @@ _aptitude()
esac esac
fi fi
#don't complete anything if these options are found.
case $prev in case $prev in
# don't complete anything if these options are found
@(autoclean|clean|forget-new|search|upgrade|update)) @(autoclean|clean|forget-new|search|upgrade|update))
return 0 return 0
;; ;;
@ -3070,8 +3068,7 @@ _update_alternatives()
# find wich mode to use and how many real args used so far # find wich mode to use and how many real args used so far
for (( i=1; i < COMP_CWORD; i++ )); do for (( i=1; i < COMP_CWORD; i++ )); do
if [[ "${COMP_WORDS[i]}" == --@(install|remove|auto|display|\ if [[ "${COMP_WORDS[i]}" == --@(install|remove|auto|display|config) ]]; then
config) ]]; then
mode=${COMP_WORDS[i]} mode=${COMP_WORDS[i]}
args=$(($COMP_CWORD - i)) args=$(($COMP_CWORD - i))
break break