From 4d0de9671f9da8cf92018ec3f929f0dfce3a229a Mon Sep 17 00:00:00 2001 From: Johnothan King Date: Mon, 27 Jul 2020 04:11:31 -0700 Subject: [PATCH] Fix spurious creation of '=' file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following is quoted from Marcin Cieślak [*]: When running under FreeBSD /bin/sh (and not ksh) we get spurious file named '=' created in the root. This is because the "checksh" function runs /bin/sh -c '(( .sh.version >= 20111111 ))' which produces a "=" file with /bin/sh as a side effect. This bug was reported in ksh93/ksh#13, but was closed in error. I was still getting the "=" file to generate on FreeBSD. bin/package, src/cmd/INIT/package.sh: - Fix the creation of a spurious '=' file by making sure /bin/sh has support for (( ... )) expressions. .gitignore: - Remove the '=' file entry since it no longer has a purpose. [*]: https://bsd.network/@saper/103196289917156347 --- .gitignore | 1 - bin/package | 1 + src/cmd/INIT/package.sh | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 07c191bb0b74..ea00bbdcab4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # Project-specific files -= arch tgz lcl diff --git a/bin/package b/bin/package index d014c576f84d..2799f0dbea1e 100755 --- a/bin/package +++ b/bin/package @@ -32,6 +32,7 @@ esac checksh() { egrep 'Version.*(88|1993)' $1 >/dev/null 2>&1 || + $1 -c '(( 2 + 2 ))' >/dev/null 2>&1 && $1 -c '(( .sh.version >= 20111111 ))' >/dev/null 2>&1 } diff --git a/src/cmd/INIT/package.sh b/src/cmd/INIT/package.sh index 0c353db6734a..7d28b020ef1c 100644 --- a/src/cmd/INIT/package.sh +++ b/src/cmd/INIT/package.sh @@ -31,6 +31,7 @@ esac checksh() { egrep 'Version.*(88|1993)' $1 >/dev/null 2>&1 || + $1 -c '(( 2 + 2 ))' >/dev/null 2>&1 && $1 -c '(( .sh.version >= 20111111 ))' >/dev/null 2>&1 }