summaryrefslogtreecommitdiff
path: root/src/chroot-tools/distcc-tool
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools/distcc-tool')
-rwxr-xr-xsrc/chroot-tools/distcc-tool14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool
index 4727450..4c6ef3f 100755
--- a/src/chroot-tools/distcc-tool
+++ b/src/chroot-tools/distcc-tool
@@ -2,7 +2,7 @@
# -*- tab-width: 4; sh-basic-offset: 4 -*-
# distcc-tool
-# Copyright (C) 2013-2014, 2017 Luke Shumaker <lukeshu@parabola.nu>
+# Copyright (C) 2013-2014, 2017-2018 Luke Shumaker <lukeshu@parabola.nu>
#
# License: GNU GPLv3+
#
@@ -34,8 +34,6 @@ if ! type gettext &>/dev/null; then
gettext() { echo "$@"; }
fi
-q0="$(printf '%q' "$0")" # quoted $0
-
panic() {
gettext 'panic: malformed call to internal function' >&2
exit 1
@@ -53,7 +51,7 @@ print() {
}
usage() {
- print "Usage: %s COMMAND [COMMAND-ARGS]" "$q0"
+ print "Usage: %q COMMAND [COMMAND-ARGS]" "$0"
print "Tool for using distcc within a networkless chroot"
echo
print "Commands:"
@@ -137,7 +135,7 @@ parse_DISTCC_HOSTS() {
;;
# ZEROCONF
+zeroconf)
- error "%s does not support the +zeroconf option" "$q0"
+ error "%q does not support the +zeroconf option" "$0"
exit 1
;;
# TCP_HOST or OLDSTYLE_TCP_HOST
@@ -161,7 +159,7 @@ parse_DISTCC_HOSTS() {
# set up port forwaring
if $forward_ports; then
- socat TCP-LISTEN:${newport},reuseaddr,fork SYSTEM:"$q0 client $HOSTID ${PORT:-3632}" &
+ socat TCP-LISTEN:${newport},reuseaddr,fork SYSTEM:"${0@Q} client $HOSTID ${PORT:-3632}" &
fi
# add the forwarded port
@@ -221,8 +219,8 @@ odaemon() {
local chrootpath=$1
umask 111
- socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$q0 server" &
- trap "jobs -p | xargs -r kill --; rm -f -- $(printf '%q' "$chrootpath/socket")" EXIT
+ socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"${0@Q} server" &
+ trap "jobs -p | xargs -r kill --; rm -f -- ${chrootpath@Q}/socket" EXIT
wait
}