Skip to content

Commit

Permalink
Fix spurious creation of '=' file
Browse files Browse the repository at this point in the history
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#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 (( ... )) arithmetic.

.gitignore:
- Remove the '=' file entry since it no longer has a purpose.

[*]: https://bsd.network/@saper/103196289917156347
  • Loading branch information
JohnoKing committed Jul 27, 2020
1 parent 69720a5 commit 5c0dbaa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Project-specific files
=
arch
tgz
lcl
Expand Down
1 change: 1 addition & 0 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions src/cmd/INIT/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 5c0dbaa

Please sign in to comment.