summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Welch <zwelch@gentoo.org>2003-03-18 06:55:24 +0000
committerZack Welch <zwelch@gentoo.org>2003-03-18 06:55:24 +0000
commit883c25dfedaa88415acf93dc64659752ccd3ca1c (patch)
tree6f866816debee4e1a7bfb179231bb245faeb8008 /sys-devel/distcc/files
parentversion bump (diff)
downloadgentoo-2-883c25dfedaa88415acf93dc64659752ccd3ca1c.tar.gz
gentoo-2-883c25dfedaa88415acf93dc64659752ccd3ca1c.tar.bz2
gentoo-2-883c25dfedaa88415acf93dc64659752ccd3ca1c.zip
usability additions, see online distcc docs for more info
Diffstat (limited to 'sys-devel/distcc/files')
-rw-r--r--sys-devel/distcc/files/1.2.3/distcc-config32
1 files changed, 27 insertions, 5 deletions
diff --git a/sys-devel/distcc/files/1.2.3/distcc-config b/sys-devel/distcc/files/1.2.3/distcc-config
index 46beb3abf67b..6073ce91dd1b 100644
--- a/sys-devel/distcc/files/1.2.3/distcc-config
+++ b/sys-devel/distcc/files/1.2.3/distcc-config
@@ -120,6 +120,10 @@ dccc_show_env() {
grep -v '^#' ${DISTCC_ENV_FILE}
}
+dccc_test_env() {
+ dccc_show_env | grep "$1" | tail -1 | sed -e "s,${1}=,,"
+}
+
dccc_load_defaults() {
rm -f ${DISTCC_ENV_FILE}
dccc_install_env
@@ -146,8 +150,10 @@ dccc_set_env() {
} >> ${DISTCC_ENV_FILE}
rm -f ${DISTCC_ENV_FILE}.tmp
env-update
- einfo "If you want to use these new settings in an existing shell,"
- einfo "you need to 'source /etc/profile' to get the changes."
+ if [ -z "${DCCC_NO_WARN}" ]; then
+ einfo "If you want to use these new settings in an existing shell,"
+ einfo "you need to 'source /etc/profile' to get the changes."
+ fi
}
dccc_get_env() {
if [ -f ${DISTCC_ENV_FILE} ]; then
@@ -203,6 +209,19 @@ dccc_install() {
###
# main routine
+# The --no-profile-warning option is meant to be used with
+# the following helper function (add to ~/.bashrc)
+#
+# distcc-config() {
+# command distcc-config --no-profile-warning "$@" && \
+# source /etc/profile
+# }
+
+if [ "${1}" = "--no-profile-warning" ]; then
+ DCCC_NO_WARN=1
+ shift
+fi
+
case "${1}" in
--get-* )
eval "dccc_$(echo ${1} | sed -e 's/^--//;s/-/_/g')"
@@ -213,6 +232,9 @@ case "${1}" in
[ "${#}" -eq 0 ] && dccc_exit "argument required"
eval "dccc_${SET_FUNC} ${*}"
;;
+ --has-path )
+ dccc_test_env PATH
+ ;;
--add-path )
dccc_set_env PATH "/usr/lib/distcc/bin"
;;
@@ -238,11 +260,11 @@ case "${1}" in
dccc_links remove "${2}"
;;
* )
- echo "usage: ${0} --set-hosts $DISTCC_HOSTS | --get-hosts"
+ echo "usage: ${0} --set-hosts DISTCC_HOSTS | --get-hosts"
echo " ${0} --set-verbose { 0 | 1 } | --get-verbose"
echo " ${0} --set-log FILE | --get-log"
- echo " ${0} --add-path | --no-path"
- echo " ${0} --install-links | --remove-links } [ CHOST ]"
+ echo -e " ${0} --add-path | --no-path\n"
+# echo " ${0} --install-links | --remove-links } [ CHOST ]"
exit 1
;;
esac