[Buildroot] [PATCH v2 1/2] dependencies: build a host python2 if no suitable one can be found

Samuel Martin s.martin49 at gmail.com
Tue May 15 22:01:57 UTC 2012


2012/5/15 Arnout Vandecappelle <arnout at mind.be>:
> On 05/13/12 12:43, Samuel Martin wrote:
>>
>> diff --git a/support/dependencies/check-host-python2.mk
>> b/support/dependencies/check-host-python2.mk
>> new file mode 100644
>> index 0000000..79197cb
>> --- /dev/null
>> +++ b/support/dependencies/check-host-python2.mk
>> @@ -0,0 +1,7 @@
>> +PYTHON2 := $(call suitable-host-package,python2)
>> +NEED_PYTHON2 :=
>
>
>  This can be removed, empty is the default.
Fair enough

>
>
>> +
>> +ifeq (,$(PYTHON2))
>> +  NEED_PYTHON2 = host-python
>> +  PYTHON2 = $(HOST_DIR)/usr/bin/python
>> +endif
>
>
>  Does this work?  I thought it wasn't allowed to mix := and = assignments.
In my test runs, it does, though I can get rid of the immediat
assignment I think.

>
>
>> diff --git a/support/dependencies/check-host-python2.sh
>> b/support/dependencies/check-host-python2.sh
>> new file mode 100755
>> index 0000000..6adb328
>> --- /dev/null
>> +++ b/support/dependencies/check-host-python2.sh
>> @@ -0,0 +1,13 @@
>> +#!/bin/sh
>> +
>> +candidates="python python2"
>> +
>> +for candidate in ${candidates} ; do
>> +  which ${candidate}&>/dev/null || continue
>> +  # restrict version of python2 to 2.6 or 2.7
>> +  if ${candidate} --version 2>&1 | grep -qE 'Python 2\.[6-7]*' ; then
>
>
>  The * is a mistake, I think.  This way, 2.5 also matches (zero
> repetitions).
You're right, .* will fix that.

> The -E is also a redundant since you're not using extended regexp.
ok


Cheers,

Sam


More information about the buildroot mailing list