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

Bug 278668

Summary: app-shells/bash: /etc/bash/bashrc.d request?
Product: Gentoo Linux Reporter: Hongjiu Zhang <voidprayer>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WORKSFORME    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Hongjiu Zhang 2009-07-22 11:40:20 UTC
Currently, if I want to emerge app-shells/bash-completion, I should  add . /etc/profile.d/bash-completion.sh in /etc/bash/bashrc in order to get global application. Will it be possible to add a /etc/bash/bashrc.d as hooks. Then app-shells/* can take advantage to apply themselves to non-login shells.

something add to /etc/bash/bashrc like:
for x in /etc/bash/bashrc.d/*
do
  . $x
done

(i know it is badly coded since i learn little about bash...)

Reproducible: Always
Comment 1 SpanKY gentoo-dev 2009-07-26 17:24:21 UTC
packages should never automatically install things into /etc/profile.d/, and the same logic applies to /etc/bash/bashrc.d/.  installation of a package is not an automatic opt-in.
Comment 2 Hongjiu Zhang 2009-07-30 10:50:07 UTC
Well, in fact, bash-completion and java-config does. They have file in /etc/profile.d. Do you mean these are either workarounds or deprecated?

Thank you for your reply.
Comment 3 SpanKY gentoo-dev 2009-08-14 07:38:24 UTC
what i meant was installing and automatically enabling.  bash-completion does not.  it installs a hook script, but it doesnt enable things unless the user has enabled it.

change your console to start a login shell and it'll go through the normal /etc/profile* setup