Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119518 - genlop "unary operator expected" bug, when use bash autocompletion
Summary: genlop "unary operator expected" bug, when use bash autocompletion
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
: 158841 168195 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-19 01:37 UTC by .:deadhead:.
Modified: 2007-04-02 11:50 UTC (History)
9 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description .:deadhead:. 2006-01-19 01:37:28 UTC
Using app-shells/bash-completion-config-0.8-r2 and app-portage/genlop-0.30.5, when i use the tab to autocomplete my query, that's the resoult:

genlop -t bash-comp{here I hit tab}bash: [: =: unary operator expected
letion-config

Then if I hit return, it show me correctly info about "bash-completion-config" package. The problem is not in bash_completion_config becouse this is the only module that act in this way
Comment 1 Stuart W. Finlayson 2006-01-20 23:14:32 UTC
The problem is in /usr/share/bash-completion/genlop on line 20.  It looks like this:

if [ ${portagedir} = "" ]; then

But it should look like this:

if [ "${portagedir}" = "" ]; then

Or this:

if [ -z "${portagedir}" ]; then

Make that change and then source the file.
Comment 2 .:deadhead:. 2006-01-21 00:57:41 UTC
Both your solutions work great! Just remeber to give env-update && source /etc/profile once you have edited the file for testing the solution.

A little boring the fact that now you have to digit the family of the package and not only its name. But this is another story :-)

Thank you stuart
Comment 3 Diogo Tridapalli 2006-03-27 05:29:24 UTC
I try and don't work for me
Comment 4 Diogo Tridapalli 2006-03-27 05:30:24 UTC
I try and don't work for me.
I still have the message:

-bash: [: =: unary operator expected
Comment 5 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-06-20 05:43:49 UTC
The whole portagedir assignment/check for emptiness/default value could be reduced to:

portagedir="$( portageq portdir )"

This will use whatever is in make.conf or default (/usr/portage) by itself.

As for the fact you need to go through category, yeah it's boring, it should probably copy out the generic gentoo (emerge) bashcomp which completes package names alone :)
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2006-12-22 08:27:14 UTC
*** Bug 158841 has been marked as a duplicate of this bug. ***
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-02-24 08:46:06 UTC
*** Bug 168195 has been marked as a duplicate of this bug. ***
Comment 8 Michael Cummings (RETIRED) gentoo-dev 2007-04-02 11:50:34 UTC
genlop has been moved into gentoo's svn per permission from the original authors to take over maintainership. The fix for this bug has been added to svn, thanks!