From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: devel@edk2.groups.io, tlaronde@polynum.com
Subject: Re: [edk2-devel] edksetup.sh: fix for non POSIX whereis(1)
Date: Mon, 21 Nov 2022 22:22:21 +0000 [thread overview]
Message-ID: <CAKbZUD3rw0YNw7pq6a4rtSzjx9HOs0p2MnZ9tWypezaLvOnbKQ@mail.gmail.com> (raw)
In-Reply-To: <Y3t4mxrmhuiMG/nN@polynum.com>
[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 1612 bytes --]
next prev parent reply other threads:[~2022-11-21 22:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 13:09 edksetup.sh: fix for non POSIX whereis(1) tlaronde
2022-11-21 22:22 ` Pedro Falcato [this message]
2022-11-22 8:14 ` [edk2-devel] " tlaronde
2022-11-22 15:40 ` Rebecca Cran
2022-11-22 16:22 ` Pedro Falcato
2022-11-22 16:26 ` tlaronde
2022-11-22 16:31 ` Pedro Falcato
2022-11-22 17:07 ` tlaronde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKbZUD3rw0YNw7pq6a4rtSzjx9HOs0p2MnZ9tWypezaLvOnbKQ@mail.gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox