Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74733 - bash-completion 20050103 and 20041017-r* specifically gentoo-bashcomp-1.0_beta4 can not retrieve PORTDIR location
Summary: bash-completion 20050103 and 20041017-r* specifically gentoo-bashcomp-1.0_be...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-12-17 01:58 UTC by Octavio Ruiz (Ta^3)
Modified: 2005-01-08 17:49 UTC (History)
1 user (show)

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


Attachments
gentoo-bashcomp-1.0_beta4-sedregexfix.diff (gentoo-bashcomp-1.0_beta4-sedregexfix.diff,463 bytes, patch)
2004-12-17 03:19 UTC, Octavio Ruiz (Ta^3)
Details | Diff
gentoo-bashcomp-1.0_beta4-sedregex2portageq.diff (gentoo-bashcomp-1.0_beta4-sedregex2portageq.diff,427 bytes, patch)
2004-12-17 03:22 UTC, Octavio Ruiz (Ta^3)
Details | Diff
gentoo-bashcomp-1.0_beta4-sedregexfix.diff (gentoo-bashcomp-1.0_beta4-sedregexfix.diff,469 bytes, patch)
2004-12-17 09:18 UTC, Octavio Ruiz (Ta^3)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Octavio Ruiz (Ta^3) 2004-12-17 01:58:56 UTC
bash-completion 20041017-r{1,2,3} specifically gentoo-bashcomp-1.0_beta4 can not retrieve PORTDIR location when the rute is inside quotes.

Ej.

emerge <TAB> -bash: cd: "/usr/portage: No such file or directory

clean     depclean  inject    metadata  prune     regen     search    sync      system    unmerge   world

Suggested Solutions.

Fix the regex (Attached)
or
Use `portageq` (Attached)
Comment 1 Javier Díaz 2004-12-17 02:44:00 UTC
Try this regrex:

sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\([^"]\+\|\S\+\).*/\1/p ; q }' /etc/make.conf /etc/make.globals
Comment 2 Octavio Ruiz (Ta^3) 2004-12-17 03:19:22 UTC
Created attachment 46202 [details, diff]
gentoo-bashcomp-1.0_beta4-sedregexfix.diff

Fix _portdir() function modifying sed regular expression.
Based on Javier's suggestion.
Comment 3 Octavio Ruiz (Ta^3) 2004-12-17 03:22:27 UTC
Created attachment 46203 [details, diff]
gentoo-bashcomp-1.0_beta4-sedregex2portageq.diff

Fix _portdir() function using portageq instead sed regular expression.
/usr/bin/portageq is part of portage.
Comment 4 Octavio Ruiz (Ta^3) 2004-12-17 03:55:56 UTC
GRrr, did not see it before... usefull info on bug #73266
Comment 5 Aaron Walker (RETIRED) gentoo-dev 2004-12-17 05:00:18 UTC
While that regex works in cases where PORTDIR is quoted, it breaks on cases when it's not (try it, there's some interesting possible completions ;p).
Comment 6 Aaron Walker (RETIRED) gentoo-dev 2004-12-17 08:25:12 UTC
sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*"\?/\1/p ; q }' \
	/etc/make.conf /etc/make.globals

can you guys test this? it works for me with or without quotes in make.conf.
Comment 7 Aaron Walker (RETIRED) gentoo-dev 2004-12-17 08:29:51 UTC
Bah sorry there was an unneeded "\? on the end.

sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \
	/etc/make.conf /etc/make.globals
Comment 8 Octavio Ruiz (Ta^3) 2004-12-17 09:18:05 UTC
Created attachment 46221 [details, diff]
gentoo-bashcomp-1.0_beta4-sedregexfix.diff

Right, my fault.. doesnt work when dont have quotes :-S

Now it works for me too with or without quotes using your regex.
Comment 9 Aaron Walker (RETIRED) gentoo-dev 2004-12-17 17:51:56 UTC
Fixed in upstream CVS; will close this bug next time Zach does a release (btw Zach, I've got a couple things to fix before you do).
Comment 10 Ciaran McCreesh 2004-12-18 01:59:09 UTC
Hrm, the better fix would be to fix your make.* files so that they always use double quotes... They're not bash files.
Comment 11 Aaron Walker (RETIRED) gentoo-dev 2004-12-18 09:34:50 UTC
Ciaran, that'd be great and all but the default make.global itself doesn't use quotes and therefore it'd be broken by default.
Comment 12 Octavio Ruiz (Ta^3) 2004-12-18 19:32:11 UTC
> Hrm, the better fix would be to fix your make.*
> files so that they always use double quotes...
> They're not bash files.

In my case, always have double quotes, in fact the problem (the bug) is only when it uses double quotes (") in PORTDIR

No problem when not using it.
Comment 13 Octavio Ruiz (Ta^3) 2005-01-08 02:21:38 UTC
Problem remains on bash-completion-20050103.
Still there are no upstream release. 20050103 is based on RELEASE_1_0_BETA_4.
Is it possible to patch the sources via epatch until upstream release a new beta version?
Comment 14 Aaron Walker (RETIRED) gentoo-dev 2005-01-08 17:49:59 UTC
20050103-r1 is in cvs.  Diff against gentoo-bashcomp cvs HEAD has been committed
until next release of gentoo-bashcomp (Zach, I'd like to fix bug 75225 before
doing so).