[U-Boot] [PATCH v2] kconfig: convert Kconfig helper script into a shell script

Stephen Warren swarren at wwwdotorg.org
Mon Aug 18 18:36:48 CEST 2014


On 08/18/2014 10:27 AM, Simon Glass wrote:
> Hi,
>
> On 18 August 2014 10:20, Stephen Warren <swarren at wwwdotorg.org
> <mailto:swarren at wwwdotorg.org>> wrote:
>
>     On 08/16/2014 10:56 PM, Masahiro Yamada wrote:
>
>         Commit 51148790 added scripts/multiconfig.py written in Python 2
>         to adjust Kconfig for U-Boot.
>
>         It has been hard for Python 3 users because Python 2 and Python 3
>         are not compatible with each other.
>
>         We are not happy about adding a new host tool dependency
>         (in this case, Python version dependency) for the core build
>         process.
>         After some discussion, we decided to use only basic tools.
>
>         The script may get a bit unreadable by shell scripting, but we
>         believe
>         it is worthwhile.
>
>         In addition, this commit revives "<board>_config" target that is
>         equivalent to "<board>_defconfig" for backwards compatibility.
>         It is annoying to adjust various projects which use U-Boot.
>
>
>     Personally, I think this change isn't justified; I see no reason to
>     replace the perfectly working existing script. Still, if that's
>     what's desired...
>
>
> Agreed, it seems unfortunate - long shell scripts are so much harder to
> work with IMO. Is it really not possible to make code compatible with
> both? Also we have lost the docs at the top of the file I think.

It might well be possible to be compatible with both Python 2 and 3, but 
the solution mentioned earlier in the thread was as simple as:

- #!/usr/bin/python
+ #!/usr/bin/python2

That would only fail on systems:

a) Without Python2 (which seems a little unlikely at the moment, and 
even if that's the case by default, there's enough Python2 code that 
surely a compat package would be available)

b) So old that there is no python2 symlink, just python. I don't know 
when python2 was added.


More information about the U-Boot mailing list