Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 158841

Summary: genlop bash-completion broken
Product: Gentoo Linux Reporter: David Benjamin <dnas.dnas>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: 2006.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to /usr/share/bash-completion/genlop

Description David Benjamin 2006-12-22 08:21:55 UTC
When pressing tab to tab-complete on genlop, one gets this error.

bash: [: =: unary operator expected

The /usr/bash-completion/genlop script does not quote some arguments in test clauses, so bash misinterprets it... (will attach a patch, there doesn't seem to be an attachment box in bug reporting spot though)

(I hope I'm not reporting this in the wrong place, the file has a Gentoo copyright on it, so I assume it's yours...)
Comment 1 David Benjamin 2006-12-22 08:26:42 UTC
Created attachment 104585 [details, diff]
patch to /usr/share/bash-completion/genlop

patchfile to fix problem...

I also went ahead and changed grep to basic regexp as opposed to extended regexp because basic has ^, *, and ., and has less of a chance to prevent collisions in the user's typing. (and it might be faster, but I doubt it)

Also, I quoted the other if statements even though they don't seem to be causing a problem right now. (The ${portagedir} one is the culprit.) Just in case some problems come up... (although, weird things would have to happen if the wc -l one breaks if)
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-12-22 08:27:14 UTC

*** This bug has been marked as a duplicate of 119518 ***

*** This bug has been marked as a duplicate of 119518 ***