summaryrefslogtreecommitdiff
path: root/src/chroot-tools/distcc-tool
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-16 22:40:57 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-16 22:40:57 -0400
commit3d9850b56c77b51edcdb2697c74ba2d1761109dc (patch)
treee5fe03bcbf6cd4d72f7c31a3129156e6784c4325 /src/chroot-tools/distcc-tool
parent52cc0c3ff27d4c48d3461d9fd898367aa4a92631 (diff)
parent813bfa255a1e46f05e08dcb587b8f417b995b2d4 (diff)
Merge branch 'master' into lukeshu/xbs
Diffstat (limited to 'src/chroot-tools/distcc-tool')
-rwxr-xr-xsrc/chroot-tools/distcc-tool18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool
index 7633029..f2e43dd 100755
--- a/src/chroot-tools/distcc-tool
+++ b/src/chroot-tools/distcc-tool
@@ -2,7 +2,9 @@
# -*- tab-width: 4; sh-basic-offset: 4 -*-
# distcc-tool
-# Copyright 2013 Luke Shumaker
+# Copyright (C) 2013-2014 Luke Shumaker <lukeshu@sbcglobal.net>
+#
+# License: GNU GPLv3+
#
# This file is part of Parabola.
#
@@ -32,6 +34,8 @@ if ! type gettext &>/dev/null; then
gettext() { echo "$@"; }
fi
+q0="$(printf '%q' "$0")" # quoted $0
+
panic() {
echo "$(gettext 'panic: malformed call to internal function')" >&2
exit 1
@@ -50,7 +54,7 @@ print() {
}
usage() {
- print "Usage: $0 COMMAND [COMMAND-ARGS]"
+ print "Usage: %s COMMAND [COMMAND-ARGS]" "$q0"
print "Tool for using distcc within a networkless chroot"
echo
print "Commands:"
@@ -125,7 +129,7 @@ parse_DISTCC_HOSTS() {
*@*)
# SSH_HOST doesn't allow custom port numbers, and even if it
# did, ssh would complain about MITM. Instead, we'll count on
- # ssh ProxyCommand being configured to used `client`.
+ # ssh ProxyCommand being configured to use `client`.
newhosts+=("$HOSTSPEC")
;;
# GLOBAL_OPTION
@@ -135,7 +139,7 @@ parse_DISTCC_HOSTS() {
;;
# ZEROCONF
+zeroconf)
- error "%s does not support the +zeroconf option" "$0"
+ error "%s does not support the +zeroconf option" "$q0"
exit 1
;;
# TCP_HOST or OLDSTYLE_TCP_HOST
@@ -159,7 +163,7 @@ parse_DISTCC_HOSTS() {
# set up port forwaring
if $forward_ports; then
- socat TCP-LISTEN:${newport},fork SYSTEM:"$0 client $HOSTID ${PORT:-3632}" &
+ socat TCP-LISTEN:${newport},fork SYSTEM:"$q0 client $HOSTID ${PORT:-3632}" &
pids+=($!)
fi
@@ -222,8 +226,8 @@ odaemon() {
local chrootpath=$1
umask 111
- socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$0 server" &
- trap "kill -- $!; rm -f '$chrootpath/socket'" EXIT
+ socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$q0 server" &
+ trap "kill -- $!; rm -f -- $(printf '%q' "$chrootpath/socket")" EXIT
wait
}