Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237614 - app-shells/bash-completion-20050121-r10: /etc/profile.d/bash-completion not loaded via /etc/profile
Summary: app-shells/bash-completion-20050121-r10: /etc/profile.d/bash-completion not l...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on: 250027
Blocks:
  Show dependency tree
 
Reported: 2008-09-14 10:08 UTC by Maximilian Haupt
Modified: 2008-12-11 20:09 UTC (History)
3 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 Maximilian Haupt 2008-09-14 10:08:08 UTC
The bash-completion file in /etc/profile.d/ has no .sh file extension as required by /etc/profile. The result is that it doesn't get loaded.

======================
max@localhost:~$ tail -n 6 /etc/profile
for sh in /etc/profile.d/*.sh ; do
        if [ -r "$sh" ] ; then
                . "$sh"
        fi
done
unset sh
======================

======================
max@localhost:~$ ls /etc/profile.d/
bash-completion  gvfs-bash-completion.sh  java-config-2.csh  java-config-2.sh
======================

If i rename the file, it gets loaded but the next problem is this:
======================
if [ "$PS1" ]; then
        if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -ge 3 ]; then
                [ -f /etc/bash_completion ] && . /etc/bash_completion
                if [ -d ~/.bash_completion.d ] ; then
                        for file in ~/.bash_completion.d/* ; do
                                [ -f $file ] && . $file
                        done
                fi
        fi
fi
unset bash bmajor bminor
======================
It does not load the files in /usr/share/bash-completion. I need to create a soft link to ~/.bash_completion.d/ or create a folder with this name and copy the files from /usr/share/bash-completion/ to this directory. 

So there should be a solution that the bash-completion.sh file in /etc/profile.d loads the files from /usr/share/bash-completion, too.

Reproducible: Always

Steps to Reproduce:

Actual Results:  
bash-completion files are not loaded

Expected Results:  
bash-completion files should get loaded

rename
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-14 16:34:32 UTC
The problem of the Summary seems valid.

[However, you appear not to be familiar with app-shells/bash-completion-config or you would know that you can use that instead of "manually" symlinking / copying files to ~/.bash_completion.d.]
Comment 2 Santiago M. Mola (RETIRED) gentoo-dev 2008-12-11 20:09:27 UTC
Fixed in app-shells/bash-completion-20060301-r3 which is now unmasked.