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

Bug 250838

Summary: app-shells/bash-completion-20060301-r3 is broken
Product: Gentoo Linux Reporter: Davide Pesavento <pesa>
Component: New packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED FIXED    
Severity: major CC: coldwind, matrix47
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Davide Pesavento (RETIRED) gentoo-dev 2008-12-13 15:21:01 UTC
After digging a bit, I found that the root cause is a typo in /etc/profile.d/bash-completion.sh

@@ -20,7 +20,7 @@
                # Some modules, including base, depend on the definitions
                # in .pre.  See the ebuild for how this is created.
                if ! $loaded_pre; then
-                   if [[ ${BASH_COMPLETION-unset} == unset ]]; then
+                   if [[ ${BASH_COMPLETION:-unset} == unset ]]; then
                        BASH_COMPLETION=/usr/share/bash-completion/base
                    fi
                    source /usr/share/bash-completion/.pre
Comment 1 Davide Pesavento (RETIRED) gentoo-dev 2008-12-14 12:00:09 UTC
There's another problem. Only login shells execute /etc/profile; non-login interactive shells source ~/.bashrc, so completions are not loaded for terminals that don't spawn a login shell (xterm, konsole, ...).
IMHO this should be mentioned in the elog message in pkg_postinst(), which is partially wrong at the moment: afaics editing ~/.bashrc is still needed...
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2008-12-14 12:04:38 UTC
Santiago, you unmasked the package. Could you please fix these issues?
Comment 3 Santiago M. Mola (RETIRED) gentoo-dev 2008-12-14 12:30:20 UTC
Wrt the first problem:

$ echo ${foo-unset}
$ export foo=bar
$ echo ${foo-unset}

yields the expected results. What's the problem you're having? What do you mean by "broken"?

And the second problem, I've just added a message on pkg_postinst as you suggested.

Closing the bug, please, reopen if the first problem persists and explain how it's broken. Thanks.
Comment 4 Davide Pesavento (RETIRED) gentoo-dev 2008-12-14 13:12:01 UTC
Nope sorry, the only problem is explained in comment #1.
Just ${foo:-bar} is "more standard" than ${foo-bar}, but it's purely a style thing, behavior is identical. ;-)
Thanks for your quick fixing.