File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,6 +224,7 @@ TRY_TEST_PROG([curl])
224224TRY_TEST_PROG([ diff] )
225225TRY_TEST_PROG([ touch] )
226226TRY_TEST_PROG([ gunzip] )
227+ TRY_TEST_PROG([ realpath] )
227228
228229if test "$missing_test_programs" -ne 0
229230then
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ TRY_TOP=" ${TRY_TOP:- $(git rev-parse --show-toplevel --show-superproject-working-tree 2>/ dev/ null || echo " ${0%/* } " )} "
4+ TRY=" $TRY_TOP /try"
5+
6+ cleanup () {
7+
8+ if [ -f " $expected " ]; then
9+ rm " $expected "
10+ fi
11+
12+ if [ -f " $out " ]; then
13+ rm " $out "
14+ fi
15+
16+ }
17+
18+ out=" $( mktemp) "
19+ expected=" $( mktemp) "
20+
21+ echo " $PWD $OLDPWD " > " $expected "
22+
23+ # shellcheck disable=SC2016
24+ " $TRY " ' echo "$PWD $OLDPWD"' > " $out " || exit 1
25+
26+ if ! diff -q " $expected " " $out " ; then
27+ exit 2
28+ fi
29+
30+ rm " $out "
31+ rm " $expected "
32+
33+ trap ' cleanup' EXIT
Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ check_case() {
2424 expected=" $( mktemp) "
2525 out=" $( mktemp) "
2626 echo " $expected_output " > " $expected "
27- TRY_SHELL=" $try_shell " SHELL=" $shell " " $TRY " " echo \"\$ TRY_SHELL \" " > " $out " || exit 1
27+ TRY_SHELL=" $try_shell " SHELL=" $shell " " $TRY " ' realpath /proc/$$/exe ' > " $out " || exit " $case "
2828
29- if ! diff -q " $expected " " $out " ; then
29+ if ! diff " $expected " " $out " ; then
3030 exit " $case "
3131 fi
3232
@@ -37,6 +37,6 @@ check_case() {
3737
3838trap ' cleanup' EXIT
3939
40- check_case " /bin/bash" " /bin/sh" " /bin/bash" " 1"
40+ check_case " /bin/bash" " /bin/sh" " $( realpath " /bin/bash" ) " " 1"
4141
42- check_case " " " /bin/bash" " /bin/bash" " 2"
42+ check_case " " " /bin/bash" " $( realpath " /bin/bash" ) " " 2"
Original file line number Diff line number Diff line change @@ -282,15 +282,15 @@ EOF
282282 cat > " $chroot_executable " << EOF
283283#!/bin/sh
284284
285- unset START_DIR SANDBOX_DIR UNION_HELPER DIRS_AND_MOUNTS TRY_EXIT_STATUS
285+ unset START_DIR SANDBOX_DIR UNION_HELPER DIRS_AND_MOUNTS TRY_EXIT_STATUS TRY_COMMAND TRY_SHELL UPDATED_DIRS_AND_MOUNTS
286286unset script_to_execute chroot_executable try_mount_log
287287
288288mount -t proc proc /proc &&
289289ln -s /proc/self/fd/0 /dev/stdin &&
290290ln -s /proc/self/fd/1 /dev/stdout &&
291291ln -s /proc/self/fd/2 /dev/stderr &&
292292cd "$START_DIR " &&
293- . "$script_to_execute "
293+ OLDPWD= $OLDPWD . "$script_to_execute "
294294EOF
295295
296296 echo " $@ " > " $script_to_execute "
You can’t perform that action at this time.
0 commit comments