stdenv-setup: Remove superfluous check for /bin/sh

The line was essentially checking whether /bin/sh exists and is
executable and if that's the case, the isScript function returns
successfully.

When asking the author of this line on IRC it seems that even they can't
remember or imagine what this was supposed to be.

In summary: Whenever /bin/sh doesn't exist during a build, *any* file
given to isScript is reported as being a script even if it isn't.

This is kinda counter-intuitive and not something what somebody would
expect from a function called "isScript".

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @edolstra
This commit is contained in:
aszlig 2018-07-09 20:43:34 +02:00
parent 98b5258955
commit 739c835515
No known key found for this signature in database
GPG Key ID: 684089CE67EBB691

View File

@ -220,7 +220,6 @@ isScript() {
local fn="$1"
local fd
local magic
if ! [ -x /bin/sh ]; then return 0; fi
exec {fd}< "$fn"
read -r -n 2 -u "$fd" magic
exec {fd}<&-