[Buildroot] [RFC PATCH 0/2] use `command -v' instead of `which'

Arnout Vandecappelle arnout at mind.be
Sun Sep 26 21:32:54 UTC 2021



On 21/09/2021 22:51, Petr Vorel wrote:
> Hi,
> 
> I've tested the patchset on dash as the default shell. But it certainly
> deserve more people to have look and test.

  Well, as the commit message says: it's POSIX so it should be supported by 
everything. which has a much smaller chance of being supported.

> 
> NOTE: If accepted, we might want to use `command -v' also in scripts:
> 
> $ git grep '$(which'
> package/fakedate/fakedate:for date in $(which -a date |tac); do
> package/transmission/S92transmission:DAEMON=$(which $NAME)

  Also:

- remove it from the documentation (adding-packages-asciidoc.txt)
- remove it from docs/manual/prerequisite.txt
- it's still used in package/doc-asciidoc.mk
- package/libxml-parser-perl/libxml-parser-perl.mk
- utils/brmake

  But these two are already applied to master, thanks!

  Regards,
  Arnout

> 
> Kind regards,
> Petr
> 
> Petr Vorel (2):
>    make: support: use `command -v' instead of `which'
>    support/dependencies: don't check for `which'
> 
>   Makefile                                      | 22 +++++++++----------
>   package/Makefile.in                           |  8 +++----
>   support/dependencies/check-host-bison-flex.mk |  4 ++--
>   support/dependencies/check-host-cmake.sh      |  2 +-
>   support/dependencies/check-host-gzip.sh       |  2 +-
>   support/dependencies/check-host-lzip.sh       |  4 ++--
>   support/dependencies/check-host-python3.sh    |  2 +-
>   support/dependencies/check-host-tar.sh        |  4 ++--
>   support/dependencies/check-host-xzcat.sh      |  4 ++--
>   support/dependencies/dependencies.sh          | 18 +++++++--------
>   .../pkg-toolchain-external.mk                 |  2 +-
>   11 files changed, 35 insertions(+), 37 deletions(-)
> 


More information about the buildroot mailing list