diff options
Diffstat (limited to 'test/testenv')
-rwxr-xr-x | test/testenv | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/test/testenv b/test/testenv index 09fd328..b570b58 100755 --- a/test/testenv +++ b/test/testenv @@ -7,12 +7,27 @@ SUDO=true while [[ $# -gt 0 ]]; do case "$1" in - --no-network) shift; unset NETWORK;; - --network) shift; NETWORK=true;; - --no-sudo) shift; unset SUDO;; - --sudo) shift; SUDO=true;; - --) shift; break;; - *) break;; + --no-network) + shift + unset NETWORK + ;; + --network) + shift + NETWORK=true + ;; + --no-sudo) + shift + unset SUDO + ;; + --sudo) + shift + SUDO=true + ;; + --) + shift + break + ;; + *) break ;; esac done export NETWORK SUDO @@ -30,7 +45,7 @@ if [[ $SUDO ]] && [[ -d "$TMPDIR/chroots" ]]; then if [[ "$(stat -f -c %T "$TMPDIR/chroots")" == btrfs ]]; then sudo find "$TMPDIR/chroots" -depth -inum 256 -exec \ - btrfs subvolume delete {} \; &>/dev/null + btrfs subvolume delete {} \; &>/dev/null fi sudo rm -rf -- "$TMPDIR/chroots" fi @@ -58,7 +73,7 @@ export _librelib_conf_sh_sysconfdir="$destdir/etc" export _librelib_conf_sh_pkgconfdir="$destdir/etc/libretools.d" sed -i 's,/usr/bin/librefetch,$(which librefetch),' \ - "${_librelib_conf_sh_sysconfdir}/makepkg.d/librefetch.conf" + "${_librelib_conf_sh_sysconfdir}/makepkg.d/librefetch.conf" # Hack to respect our variables in sudo install -Dm755 /dev/stdin "$destdir/usr/bin/testsudo" <<-'eot' @@ -74,7 +89,7 @@ env+=("$var=${!var}") done sudo "${env[@]}" "$@" - eot + eot # Hack to work around GnuPG being stupid with locating gpg-agent's socket install -Dm755 /dev/stdin "$destdir/usr/bin/gpg" <<-'eot' #!/bin/bash @@ -83,7 +98,7 @@ export HOME=/var/empty fi exec /usr/bin/gpg "$@" - eot + eot install -Dm755 /dev/stdin "$destdir/usr/bin/gpg-connect-agent" <<-'eot' #!/bin/bash export GNUPGHOME="${GNUPGHOME:-$HOME/.gnupg}" @@ -91,7 +106,7 @@ export HOME=/var/empty fi exec /usr/bin/gpg-connect-agent "$@" - eot + eot # Hack to work around ssh ignoring HOME and instead looking the homedir in NSS install -Dm755 /dev/stdin "$destdir/usr/bin/ssh" <<-'eot' #!/bin/bash @@ -109,7 +124,7 @@ -o UserKnownHostsFile="$HOME/.ssh/known_hosts" \ -F "$HOME/.ssh/config" \ "$@" - eot + eot # Run the tests command -- "$@" |