Date: Sat, 30 Jan 2021 15:11:46 GMT From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: c48240fa6f8e - stable/12 - sh/tests: Add a second kind of binary scripts without #! Message-ID: <202101301511.10UFBk6F033037@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=c48240fa6f8e168325a278f8b8cc075779615ddf commit c48240fa6f8e168325a278f8b8cc075779615ddf Author: Jilles Tjoelker <jilles@FreeBSD.org> AuthorDate: 2021-01-03 20:27:50 +0000 Commit: Jilles Tjoelker <jilles@FreeBSD.org> CommitDate: 2021-01-30 15:10:26 +0000 sh/tests: Add a second kind of binary scripts without #! One of the reasons for git commit e0f5c1387df23c8c4811f5b24a7ef6ecac51a71a was to make "actually portable executables" work. Add a test that is more like those. MFC after: 1 week (cherry picked from commit 52981a1694be7a70013e5149c020706c9b6411f9) --- bin/sh/tests/execution/Makefile | 1 + bin/sh/tests/execution/shellproc7.0 | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/bin/sh/tests/execution/Makefile b/bin/sh/tests/execution/Makefile index c7f68a7404aa..ddf2ff7f53b6 100644 --- a/bin/sh/tests/execution/Makefile +++ b/bin/sh/tests/execution/Makefile @@ -61,6 +61,7 @@ ${PACKAGE}FILES+= shellproc3.0 ${PACKAGE}FILES+= shellproc4.0 ${PACKAGE}FILES+= shellproc5.0 ${PACKAGE}FILES+= shellproc6.0 +${PACKAGE}FILES+= shellproc7.0 ${PACKAGE}FILES+= subshell1.0 subshell1.0.stdout ${PACKAGE}FILES+= subshell2.0 ${PACKAGE}FILES+= subshell3.0 diff --git a/bin/sh/tests/execution/shellproc7.0 b/bin/sh/tests/execution/shellproc7.0 new file mode 100644 index 000000000000..2a99ae74c151 --- /dev/null +++ b/bin/sh/tests/execution/shellproc7.0 @@ -0,0 +1,10 @@ +# $FreeBSD$ +# Non-POSIX trickery that is widely supported, +# used by https://justine.lol/ape.html + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf "MZqFpD='\n\0'\n#'\"\necho this is a test\n" >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +[ "`testshellproc`" = "this is a test" ]
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101301511.10UFBk6F033037>