aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-10-28 23:50:00 -0400
committerMike Frysinger <vapier@gentoo.org>2021-10-28 23:50:00 -0400
commit9a026d957ffc18ab4f4f7d069f4373ddf190eca9 (patch)
treef8e0ef9c56121397b750f4f82c53212de79ea946 /tests
parentsandbox: avoid repetitive strlen calculations when building cmdline (diff)
downloadsandbox-9a026d957ffc18ab4f4f7d069f4373ddf190eca9.tar.gz
sandbox-9a026d957ffc18ab4f4f7d069f4373ddf190eca9.tar.bz2
sandbox-9a026d957ffc18ab4f4f7d069f4373ddf190eca9.zip
sandbox: change interface to make it easier to pass thru
The sandbox command line is passed to a shell for execution. This can be a bit awkward to quote right if you weren't expecting it, and even if you were. Change the default behavior to be more like `env` where the arguments, as they are, get passed through and run. If people want the old shell behavior, they can use the -c option akin to `bash -c`. Bug: https://bugs.gentoo.org/265907 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/git-bisector.sh15
-rw-r--r--tests/local.at2
2 files changed, 14 insertions, 3 deletions
diff --git a/tests/git-bisector.sh b/tests/git-bisector.sh
index c45db6e..b64dff6 100755
--- a/tests/git-bisector.sh
+++ b/tests/git-bisector.sh
@@ -21,10 +21,21 @@ make="make -s -j"
cat << EOF > git-run.sh
#!/bin/sh
./autogen.sh
-./configure -q -C $(sandbox -V | tail -n1)
+# Newer versions of sandbox can run configure for us.
+# Should drop old support around Jan 2023.
+if sandbox --help | grep -q -e--run-configure ; then
+ sandbox --run-configure -q -C
+else
+ ./configure -q -C $(sandbox -V | tail -n1)
+fi
${make} clean
${make}
-./src/sandbox.sh . ./data/sandbox.bashrc \; . ./git-run-sandbox.sh
+opt=
+# Older versions of sandbox implied -c all the time.
+if ./src/sandbox.sh --help | grep -q -e--bash ; then
+ opt="-c"
+fi
+./src/sandbox.sh ${opt} . ./data/sandbox.bashrc \; . ./git-run-sandbox.sh
EOF
chmod a+rx git-run.sh
diff --git a/tests/local.at b/tests/local.at
index 95db774..028961d 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -6,7 +6,7 @@ dnl due to the default PM test env having that predict.
m4_defun([SB_RUN],[\
env \
SANDBOX_LOG="$PWD/sandbox.log" \
- sandbox.sh \
+ sandbox.sh -c \
addpredict / \; \
addwrite "${PWD%/*}" \; \
set -x \; \