From 739c835515036fcc21cd5f32fc0e37991df5dc18 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 9 Jul 2018 20:43:34 +0200 Subject: [PATCH] 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 Cc: @edolstra --- pkgs/stdenv/generic/setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 87465df1482a..26d28609d877 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -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}<&-