substitute path to bash_completion time in profile script according to actual installation path

master
Guillaume Rousse 2009-12-29 23:50:08 +01:00
parent 1691618a65
commit dd30aa427c
3 changed files with 17 additions and 2 deletions

View File

@ -155,5 +155,10 @@ bashcomp_DATA = contrib/abook \
profiledir = $(sysconfdir)/profile.d
profile_DATA = bash_completion.sh
EXTRA_DIST = CHANGES $(sysconf_DATA) $(bashcomp_DATA) $(profile_DATA) \
bash_completion.sh: bash_completion.sh.in Makefile
sed -e 's|@sysconfdir[@]|$(sysconfdir)|' <$(srcdir)/$@.in >$@
CLEANFILES = bash_completion.sh
EXTRA_DIST = CHANGES $(sysconf_DATA) $(bashcomp_DATA) bash_completion.sh.in \
contrib/_modules contrib/_subversion contrib/_yum contrib/_yum-utils

View File

@ -5,6 +5,6 @@
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}
if [ $bmajor -ge 3 -a -r /etc/bash_completion ]; then
# Source completion code.
. /etc/bash_completion
. /usr/local/etc/bash_completion
fi
unset bash bmajor

10
bash_completion.sh.in Normal file
View File

@ -0,0 +1,10 @@
# Check for interactive bash and that we haven't already been sourced.
[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return
# Check for recent enough version of bash.
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}
if [ $bmajor -ge 3 -a -r /etc/bash_completion ]; then
# Source completion code.
. @sysconfdir@/bash_completion
fi
unset bash bmajor