diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-02 23:57:57 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-03 03:59:03 -0400 |
commit | ddd4379f906fb84588093099a81d5ea633e6a7c7 (patch) | |
tree | 5cef537d15ac49bf8f290293df18af532dbaa709 /src/chroot-tools | |
parent | fa68208eb07b39fecb5084c136c9329a483a001b (diff) |
Use Bash 4.4 @Q instead of %q
Diffstat (limited to 'src/chroot-tools')
-rw-r--r-- | src/chroot-tools/chcleanup.in | 2 | ||||
-rwxr-xr-x | src/chroot-tools/distcc-tool | 14 | ||||
-rwxr-xr-x | src/chroot-tools/librechroot | 2 | ||||
-rwxr-xr-x | src/chroot-tools/libremakepkg | 2 |
4 files changed, 9 insertions, 11 deletions
diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in index e72ab45..7826753 100644 --- a/src/chroot-tools/chcleanup.in +++ b/src/chroot-tools/chcleanup.in @@ -70,7 +70,7 @@ cp /repo/repo.db /var/lib/pacman/sync/repo.db # Setup the temporary directory TEMPDIR="$(mktemp --tmpdir -d "${0##*/}.XXXXXXXXXX")" -trap "rm -rf -- $(printf '%q' "$TEMPDIR")" EXIT +trap "rm -rf -- ${TEMPDIR@Q}" EXIT cp -a /var/lib/pacman/sync "${TEMPDIR}/" pkglist="${TEMPDIR}"/pkglist.txt 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 } diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index d763830..6db11a8 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -479,7 +479,7 @@ main() { arch-nspawn "$copydir" pacman -Syu --noconfirm ;; clean-pkgs) - trap "rm -f -- $(printf '%q ' "$copydir"/{bin/chcleanup,chrootexec})" EXIT + trap "rm -f -- ${copydir@Q}/{bin/chcleanup,chrootexec}" EXIT install -m755 "$(librelib chroot/chcleanup)" "$copydir/bin/chcleanup" printf '%s\n' \ '#!/bin/bash' \ diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 2efbeea..f5f4855 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -127,7 +127,7 @@ build() ( prepare_chroot "$copydir" "$LIBREHOME" "$repack" false "${run_ynet[@]}" /chrootprepare "${makepkg_args[@]}" |& indent run_hook pre_build "$copydir" - trap "run_hook post_build $(printf '%q' "$copydir")" EXIT + trap "run_hook post_build ${copydir@Q}" EXIT "${run_nnet[@]}" /chrootbuild "${makepkg_args[@]}" |& indent ) |