On Thu, 4 Aug 2005, Eric Blake wrote: > According to John Morrison on 8/4/2005 6:52 AM: > > > > I wouldn't have thought there would be much/any speed gained doing it > > this way...? > > There's no speed difference, whether bash_completion is sourced by > /etc/profile.d/completion.sh or by ~/.bashrc. The difference is that > sourced by ~/.bashrc, the user explicitly turned it on, so they are aware > that they caused the delay; plus multiple users sharing a machine can > independently decide whether or not they want to take the delay. But with > /etc/profile.d, the user has no choice; bash_completion WILL be sourced, > and cause the delay.
What if the user has to set an environment variable for /etc/profile.d/bash-completion.sh to run? You could check for that environment variable in /etc/profile.d/bash-completion.sh and exit if it's not set. And it's easier than editing their .bashrc... BTW, one drawback of the /etc/profile.d approach is that it only works for login shells. > I'm afraid there are too many people who blindly install every package > without realizing the implications, but I'm willing for the next release > of bash-completion to use /etc/profile.d if there are enough complaints > of why the user has to edit ~/.bashrc in addition to installing > bash-completion. (I guess if I ever do add an /etc/profild.d hook, I'd > have to make sure bash_completion is idempotent, so that sourcing it the > second time is a no-op, rather than doubling the delay of users that > already edited their ~/.bashrc.) > > > If somebody installs bash_completion then they shouldn't have a problem > > with something taking longer, if they do, they should uninstall it > > (removing the /etc/profile.d/ file) :) > > Removing the /etc/profile.d file is a partial solution, but then cygcheck > would report the bash-completion package is incomplete. You could also stick the file in /etc/defaults/etc/profile.d, and have the config script copy it to /etc/profile.d... Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ [EMAIL PROTECTED] ZZZzz /,`.-'`' -. ;-;;,_ [EMAIL PROTECTED] |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! If there's any real truth it's that the entire multidimensional infinity of the Universe is almost certainly being run by a bunch of maniacs. /DA