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

Thomas De Schampheleire patrickdepinguin at gmail.com
Fri May 2 12:20:42 UTC 2014


Hi Maxime,

On Fri, Mar 28, 2014 at 7:41 PM, Maxime Hadjinlian
<maxime.hadjinlian at gmail.com> wrote:
> Hi all,
>
> On Sun, Feb 23, 2014 at 7:12 PM, Maxime Hadjinlian
> <maxime.hadjinlian at gmail.com> wrote:
>> 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
>
> Just a bump.
> Thomas, if I remember correctly, you were not opposed to this patch ?
> As explained, it has been found that dependencies.sh needs a few other
> rounds of patch so it would be better shaped, but that can be done
> later.

Is there a particular reason why the first part of the make check is
not using check_prog_host ?

Another comment is that I find the split between this and the second
patch (classpath) strange: I would move the addition of
BR2_NEEDS_HOST_JAVAC / JAR to that second patch.

Best regards,
Thomas


More information about the buildroot mailing list