Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250838 - app-shells/bash-completion-20060301-r3 is broken
Summary: app-shells/bash-completion-20060301-r3 is broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-13 15:21 UTC by Davide Pesavento
Modified: 2008-12-14 13:12 UTC (History)
2 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 Davide Pesavento 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 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 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 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.