[OpenWrt-Devel] Question regarding call python script
jason.wu.misc at gmail.com
Mon Mar 14 09:01:12 EDT 2016
On 14/03/2016 5:20 PM, John Crispin wrote:
> On 14/03/2016 03:55, Jason Wu wrote:
>> On 13/03/2016 8:41 PM, Bastian Bittorf wrote:
>>> Using n-dimensional arrays in build scripts is
>>> a rare usecase. you can easily switch to AWK if this
>>> fits more. But using Perl or Python should be avoided,
>>> because it adds more complexity to the dependencies
>>> and leads to more headache when maintaining:
>> Just to be sure, are you saying that we should also avoid indexed array
>> in bash? It is possible to create n-dimensional arrays with indexed
>> array. The main reason for this is to be sure that I am on the right track.
>> IMHO, every script language has it own pros and cons. But for a complex
>> build system (such as buildroot/openwrt), consistency, compatibility and
>> dependencies are difficult to maintain and also makes difficult for
>> testing (the number of possible test required to ensure the
>> compatibility increases exponential as we add more dependency). For
>> example, RHEL5 uses bash version 3.x which does not support associated
>> array. Sometimes some of the dependency can be avoid and best to avoid
>> from maintainers point of view.
> please explain what problem you have that requires arrays to solve it.
I am creating a Image Tree Source (ITS) generator script which allows
user to passing to the image properties such as image type
(kernel/ftd/rootfs) or hash algorithm, signature, compression, entry
point and load addr, and which configuration properties. Since the ITS
allows multiple images (multiple kernel/fdt/rootfs) and multiple
configuration so two dimension array was used to store the data.
The main reason I asked is because the solution can be implemented as
simple structure (like Bastian suggested) or used indexed arrays. I
guess my question which is preferred in OpenWrt community.
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
More information about the openwrt-devel