if you're emerging a specific version of a package (=pkgname-1.0.0), and you attempt to tab-complete when the version number entered so far is illegitimate, instead of not completing, you'll get "\* " appended to the command line. Reproducible: Always Steps to Reproduce: 1. emerge -aDtv =gentoo-bashcomp-1<tab> Actual Results: root ~ # emerge -aDtv =gentoo-bashcomp-1\* Expected Results: since there is no version of gentoo-bashcomp starting with 1... <beep> root ~ # emerge -aDtv =gentoo-bashcomp-1 this occurs with any non-existant package version, subversion, beta date, r-bump, etc. my installed version is gentoo-bashcomp-20050506.
doesnt seem to just happen with versions either emerge =non-existent<TAB> does the same thing.
Created attachment 58824 [details, diff] do shopt -qs nullglob in subshell The completion uses the cache in PORTDIR/metadata/cache to complete versions of packages. There is a for-loop that removes the 'category/' prefix for every expansion of *-*/COMPLETEME*. Thus, if *-*/COMPLETEME* expands to nothing, '*-*/' is removed and 'COMPLETEME<tab>' becomes 'COMPLETEME*'. There are two fixes I can think of (The patch uses the first one): 1) shopt -qs nullglob in the subshell ("If the nullglob option is set, and no matches are found, the word is removed") or 2) [[ -f $i ]] && echo ${i##*/}
heh victim of my own advice. I was just telling slarti the other day how you should always check for existence when using glob loops :) Anyways, it's fixed upstream. Will be fixed next release.
20050516 released.