summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mageia.org>2012-03-07 21:31:29 +0000
committerGuillaume Rousse <guillomovitch@mageia.org>2012-03-07 21:31:29 +0000
commitc33f120889dd01c5b52f5d7d0fcf4af25b561ed2 (patch)
treee7974bdde1014a1968c0206943c5ab570dbcb98b
parent3aa8854562c4cf65db0d80601371cb7298d36aaa (diff)
downloadurpmi-c33f120889dd01c5b52f5d7d0fcf4af25b561ed2.tar
urpmi-c33f120889dd01c5b52f5d7d0fcf4af25b561ed2.tar.gz
urpmi-c33f120889dd01c5b52f5d7d0fcf4af25b561ed2.tar.bz2
urpmi-c33f120889dd01c5b52f5d7d0fcf4af25b561ed2.tar.xz
urpmi-c33f120889dd01c5b52f5d7d0fcf4af25b561ed2.zip
new attempt to use pre-computed package name files to complete on package names
-rw-r--r--urpmi.bash-completion12
1 files changed, 9 insertions, 3 deletions
diff --git a/urpmi.bash-completion b/urpmi.bash-completion
index 2fad4a72..92afb816 100644
--- a/urpmi.bash-completion
+++ b/urpmi.bash-completion
@@ -27,9 +27,10 @@ _urpmi_aliases()
_urpmi_packages()
{
- local options
+ local options medias
- # find media selection options
+ # find media selection options
+ options="active"
for (( i=1; i < COMP_CWORD; i++ )); do
case "${COMP_WORDS[i]}" in
--@\(excludemedia|media\))
@@ -42,7 +43,12 @@ _urpmi_packages()
esac
done
- COMPREPLY=( $( compgen -W "$(urpmq $options --list)" -- $cur ) )
+ # get active media list
+ _urpmi_get_medias $options
+
+ for media in $medias; do
+ COMPREPLY+=( $( compgen -W "$(grep ^$cur /var/lib/urpmi/names.$media 2>/dev/null)" ) )
+ done
}
# urpmi completion