_rpm(): some clean up

This commit is contained in:
ianmacd 2002-02-19 21:49:13 +00:00
parent 56b80cfc22
commit 96860dc0e5

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.133 2002/02/19 18:37:15 ianmacd Exp $ # $Id: bash_completion,v 1.134 2002/02/19 22:49:13 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -649,7 +649,7 @@ _rpm()
if [ -r /var/log/rpmpkgs -a \ if [ -r /var/log/rpmpkgs -a \
/var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then
# using RHL 7.2 - this is quicker than querying the DB # using RHL 7.2 - this is quicker than querying the DB
COMPREPLY=( ${COMPREPLY[@]} COMPREPLY=( ${COMPREPLY[@]} \
$( sed -ne 's/^\('$cur'.*\)-[0-9a-zA-Z._]\+-[0-9a-z.]\+.*\.rpm$/\1/p' /var/log/rpmpkgs ) ) $( sed -ne 's/^\('$cur'.*\)-[0-9a-zA-Z._]\+-[0-9a-z.]\+.*\.rpm$/\1/p' /var/log/rpmpkgs ) )
else else
COMPREPLY=( ${COMPREPLY[@]} $( rpm -qa | \ COMPREPLY=( ${COMPREPLY[@]} $( rpm -qa | \
@ -837,9 +837,7 @@ _rpm()
else else
_expand || return 0 _expand || return 0
# complete on .tar files # complete on .tar files
COMPREPLY=( $( compgen -f -X '!*.@(tgz|tar.+(gz|bz2))' \ file_glob '@(tgz|tar.@(gz|bz2))'
$cur ) )
COMPREPLY=( ${COMPREPLY[@]} $( compgen -d $cur ) )
fi fi
return 0 return 0
;; ;;
@ -857,8 +855,7 @@ _rpm()
--tarbuild) --tarbuild)
_expand || return 0 _expand || return 0
# complete on tarred sources # complete on tarred sources
COMPREPLY=( $( compgen -f -X '!*.@(tgz|tar.+(gz|bz2))' $cur ) ) file_glob '@(tgz|tar.@(gz|bz2))'
COMPREPLY=( ${COMPREPLY[@]} $( compgen -d $cur ) )
return 0 return 0
;; ;;
--@(re|add)sign) --@(re|add)sign)