On Mon, Nov 21, 2022 at 9:21 PM <tlaronde@polynum.com> wrote:
diff --git a/edksetup.sh b/edksetup.sh
index 06d2f041e6..46b295c430 100755
--- a/edksetup.sh
+++ b/edksetup.sh
@@ -105,6 +105,19 @@ function SetupEnv()
   fi
 }

+# whereis(1) is not a POSIX utility and, for example, its implementation
+# in NetBSD is different form the Linux one.
+#
+function whereis()
+{
+  (
+    IFS=:
+    for dir in $PATH; do
+      eval ls $dir/${1}* 2>/dev/null || true
+    done
+  )
+}
Hi Thierry,

First of all, thanks for the patch! I had noticed this problem when running edksetup.sh on a POSIX but not quite Linux system before.

I kind of dislike your solution. Does NetBSD ship /bin/which by default? I think replacing whereis with "which -a" would be a lot better.
I don't think there's a 100% standard way to do this in POSIX, as which isn't POSIX either, and your solution seems... hacky?
 
Also, please send patches in the standard git format (git commit -s + git format-patch + git send-email with the proper CCs to the maintainers, see the proper guides for more details).

Thanks,
Pedro