On Tue, Sep 7, 2010 at 3:20 PM, Scott Parkerson <s...@snortasprocket.net> wrote:
> On Mon, Sep 6, 2010 at 8:11 AM, Rune Morling <e...@foresightlinux.org> wrote:
>
>> For the record, /etc/bashrc currently only loads /etc/profile.d/*.sh
>> scripts when the shell is non-interactive.
>
> Wha? If so, then that's broken!
>
> However, I think you're wrong on this one and that they are loaded
> just fine. Otherwise, all the JAVA* stuff wouldn't be set properly for
> me, and it currently is being set (and it's specified in
> /etc/profile.d/*.sh).
>
> --sgp

Just to be sure, I traced execution of my .bashrc (set -xv at the top
and set +xv at the bottom for those who think that seeing is
believing).  And what do you know ... you were right.  Major brainfart
on my part, I'm afraid...

Anyway, in that case the obvious solution seems to be to have
/etc/profile.d/<vcs>-bash_completion.sh source the completions for
each <vcs> if the shell is interactive.  Perhaps something like this:

)$ cat /etc/profile.d/bzr-bash_completion.sh
if [ "$PS1" ]; then
  # the bzr completion script needs this
  shopt -s extglob
  D="/etc/bash_completion.d"
  if [ -f "$D"/bzr ]; then
    . "$D"/bzr
  fi
fi


  --ermo
_______________________________________________
Foresight-devel mailing list
Foresight-devel@lists.rpath.org
http://lists.rpath.org/mailman/listinfo/foresight-devel

Reply via email to