Bug 119518 - genlop "unary operator expected" bug, when use bash autocompletion
Bug#: 119518 Product:  Portage Development Version: 2.0 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: tools-portage@gentoo.org Reported By: deadhead@goodfellow.it
Component: Tools
URL: 
Summary: genlop "unary operator expected" bug, when use bash autocompletion
Keywords:  
Status Whiteboard: 
Opened: 2006-01-19 01:37 0000
Description:   Opened: 2006-01-19 01:37 0000
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 From Stuart W. Finlayson 2006-01-20 23:14:32 0000 -------
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 From .:deadhead:. 2006-01-21 00:57:41 0000 -------
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 From Diogo Tridapalli 2006-03-27 05:29:24 0000 -------
I try and don't work for me

------- Comment #4 From Diogo Tridapalli 2006-03-27 05:30:24 0000 -------
I try and don't work for me.
I still have the message:

-bash: [: =: unary operator expected

------- Comment #5 From Vlastimil Babka (Caster) 2006-06-20 05:43:49 0000 -------
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 From Jakub Moc (RETIRED) 2006-12-22 08:27:14 0000 -------
*** Bug 158841 has been marked as a duplicate of this bug. ***

------- Comment #7 From Jakub Moc (RETIRED) 2007-02-24 08:46:06 0000 -------
*** Bug 168195 has been marked as a duplicate of this bug. ***

------- Comment #8 From Michael Cummings (RETIRED) 2007-04-02 11:50:34 0000 -------
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!