First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 92479
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Shell Tools Herd Bugs <shell-tools@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Ryan Hill <dirtyepic@gentoo.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
bash-compl.pkg-vers2.patch do shopt -qs nullglob in subshell patch Emil Beinroth 2005-05-13 10:03 0000 473 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 92479 depends on: Show dependency tree
Show dependency graph
Bug 92479 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-05-13 02:28 0000
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.

------- Comment #1 From Aaron Walker (RETIRED) 2005-05-13 07:01:39 0000 -------
doesnt seem to just happen with versions either

emerge =non-existent<TAB> does the same thing.

------- Comment #2 From Emil Beinroth 2005-05-13 10:03:56 0000 -------
Created an attachment (id=58824) [edit]
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##*/}

------- Comment #3 From Aaron Walker (RETIRED) 2005-05-13 10:20:35 0000 -------
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.

------- Comment #4 From Aaron Walker (RETIRED) 2005-05-15 23:54:42 0000 -------
20050516 released.

First Last Prev Next    No search results available      Search page      Enter new bug