Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36910 - bash-completion broken for "emerge /path/to/any.ebuild"
Summary: bash-completion broken for "emerge /path/to/any.ebuild"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Christian Birchinger (RETIRED)
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-31 12:46 UTC by Ed Catmur
Modified: 2004-01-16 07:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
2-liner patch (bcdg.patch,521 bytes, patch)
2003-12-31 12:53 UTC, Ed Catmur
Details | Diff
Latest and greatest. (gentoo,23.20 KB, text/plain)
2004-01-03 15:04 UTC, Zach Forrest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2003-12-31 12:46:53 UTC
Quote: (from forums)

> I type:
> emerge /usr/port [tab]
> 
> The completion works as expected:
> "/usr/portage/"
> 
> I then type:
> kde-b [tab]
> 
> The completion looks like this:
> "/usr/portage/kde-base " {note trailing space, no trailing slash}
> 
> I expect the completion to look like this:
> "/usr/portage/kde-base/" 

Patch to /etc/bash_completion.d/gentoo to follow.
Comment 1 Ed Catmur 2003-12-31 12:53:27 UTC
Created attachment 22920 [details, diff]
2-liner patch

Content:

@@ -286,7 +286,9 @@
		fi
  
		if [ "${cur}" ]; then
-			if [ $(echo "${cur}" | grep '/') ]; then
+			if [[ "${cur} " == @('/'|'.'|'~'|'$')* ]]; then
+				COMPREPLY=''
+			elif [ $(echo "${cur}" | grep '/') ]; then
				setbig=$(compgen -G "${cur}*" |
${sedcmd})"${systemactions}"
				COMPREPLY=($(echo "${setbig}" | $grepcmd))
			else

Using the same conditional expression as in the unmerge stanza to differentiate
paths (absolute and relative) from Gentoo package names.
Comment 2 Zach Forrest 2004-01-03 15:04:12 UTC
Created attachment 23107 [details]
Latest and greatest.

This incorporates the patch previously attached (thanks, Ed) and contains
improvements to the previous version. Please let me know if you encounter any
problems.
Comment 3 Christian Birchinger (RETIRED) gentoo-dev 2004-01-04 07:50:04 UTC
Do you have a cleaned up (Removed commented out lines etc.) version for next
release? I have to merge it then with the other commited functions which are
added in the current version of gentoo.completion (20031215).
Comment 4 Christian Birchinger (RETIRED) gentoo-dev 2004-01-04 08:13:36 UTC
Shouldn't the '| grep ^${cur}' be replaced with '-- ${cur}' ?
Removes the need for one external command which is always good
in bash-completion.
Comment 5 Christian Birchinger (RETIRED) gentoo-dev 2004-01-16 07:17:36 UTC
I'm closing this bug because a fix has been added to the current version.

I'm still willing to update the whole gentoo complition but i need a cleaned version for a release.