[Buildroot] [PATCH v2 1/2] infra: Add generic check_prog_host function

Maxime Hadjinlian maxime.hadjinlian at gmail.com
Sun Feb 23 18:12:05 UTC 2014


On Sun, Feb 23, 2014 at 6:40 PM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> Dear Maxime Hadjinlian,
>
> On Sun, 23 Feb 2014 17:17:40 +0100, Maxime Hadjinlian wrote:
>
>> +# Verify that which is installed
>> +check_prog_host "which"
>
> Since your function check_prog_host uses which to determine if the
> program exists, isn't it weird to use which to verify it?
Agreed but that was the original check also which I found a little in
the first place. But since this patch is here only to introduce and
use a function, I didn't see how to change that here.
>
> Your check_host_prog function could also be used in:
>
> # Check that a few mandatory programs are installed
> missing_progs="no"
> for prog in patch perl tar wget cpio python unzip rsync bc ${DL_TOOLS} ; do
>         if ! which $prog > /dev/null ; then
>                 echo "You must install '$prog' on your build machine";
>                 missing_progs="yes"
>                 if test $prog = "svn" ; then
>                         echo "  svn is usually part of the subversion package in your distribution"
>                 elif test $prog = "hg" ; then
>                         echo "  hg is usually part of the mercurial package in your distribution"
>                 elif test $prog = "zcat" ; then
>                         echo "  zcat is usually part of the gzip package in your distribution"
>                 elif test $prog = "bzcat" ; then
>                         echo "  bzcat is usually part of the bzip2 package in your distribution"
>                 fi
>         fi
> done
>
> if test "${missing_progs}" = "yes" ; then
>         exit 1
> fi
>
> Though you see that this loop has this missing_progs variable that
> allows to list all the missing programs, and only abort at the end.
I wanted to keep this one as is for the moment.
As you point out, it uses the exact mechanisms we want for all the
dependencies.sh, and it would be part of a follow up patch later one,
which would uses the same mechanisms but all over the dependencies.sh.
Which is want we want in the end.
This first patch is mostly a follow up of the previous one, which
added the BR2_NEEDS_HOST_JAVA
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com


More information about the buildroot mailing list