Re: [OpenWrt-Devel] Question regarding call python script

2016-03-14 Thread Jason Wu
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

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-14 Thread John Crispin
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

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-14 Thread Bastian Bittorf
* Jason Wu [14.03.2016 07:39]: > 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. "Complexity is a cost, spend it wisely."

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-13 Thread Jason Wu
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 maintainin

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-13 Thread Bastian Bittorf
* Karl Palsson [13.03.2016 10:00]: > > array_set "test" 7 > > array_get 7 > > > > or for 2-dimensional arrays: > > array_set "2dim" 3 14 > > array_get 3 14 > > You know, this is _exactly_ why people want to use python or even > perl instead of bash/awk/sed. > > This is a great, wonderful soluti

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-12 Thread John Crispin
On 12/03/2016 23:43, Karl Palsson wrote: > > Bastian Bittorf wrote: >> * Paul Fertser [11.03.2016 11:15]: >>> As a sidenote, POSIX shell doesn't support associative arrays (which >>> were mentioned in this thread), so it's probably worth clarifying >>> whether it's ok to require bash >= 4 for

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-12 Thread Karl Palsson
Bastian Bittorf wrote: > * Paul Fertser [11.03.2016 11:15]: > > As a sidenote, POSIX shell doesn't support associative arrays (which > > were mentioned in this thread), so it's probably worth clarifying > > whether it's ok to require bash >= 4 for OpenWrt build scripts or not. > > yes, POSIX is

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-11 Thread Bastian Bittorf
* Paul Fertser [11.03.2016 11:15]: > As a sidenote, POSIX shell doesn't support associative arrays (which > were mentioned in this thread), so it's probably worth clarifying > whether it's ok to require bash >= 4 for OpenWrt build scripts or not. yes, POSIX is "missing" some goodies of a full bas

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-11 Thread Paul Fertser
On Fri, Mar 11, 2016 at 08:37:31PM +1000, Jason Wu wrote: > >>As a sidenote, POSIX shell doesn't support associative arrays (which > >>were mentioned in this thread), so it's probably worth clarifying > >>whether it's ok to require bash >= 4 for OpenWrt build scripts or not. > >> > > > >what exactl

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-11 Thread Jason Wu
On 11/03/2016 8:12 PM, John Crispin wrote: On 11/03/2016 11:11, Paul Fertser wrote: Hey folks, Bastian Bittorf writes: * John Crispin [11.03.2016 06:27]: depends on what you want to do. i dont really see anything that cannot be handled using shell. what exactly do you want to write in p

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-11 Thread John Crispin
On 11/03/2016 11:11, Paul Fertser wrote: > Hey folks, > > Bastian Bittorf writes: >> * John Crispin [11.03.2016 06:27]: >>> depends on what you want to do. i dont really see anything that cannot >>> be handled using shell. what exactly do you want to write in python ? >> >> also in general i t

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-11 Thread Paul Fertser
Hey folks, Bastian Bittorf writes: > * John Crispin [11.03.2016 06:27]: >> depends on what you want to do. i dont really see anything that cannot >> be handled using shell. what exactly do you want to write in python ? > > also in general i think it's a good idea to have > less dependency than m

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-11 Thread Jason Wu
On 11/03/2016 4:45 PM, John Crispin wrote: please dont top post. i see your point but there is no technical reason to use python beyond you being more skilled in python than the other languages. i personally would prefer to stick to shell as that is what the rest of the system uses. so i am b

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread Bastian Bittorf
* John Crispin [11.03.2016 06:27]: > depends on what you want to do. i dont really see anything that cannot > be handled using shell. what exactly do you want to write in python ? also in general i think it's a good idea to have less dependency than more. personally 8-) i want to see perl and awk

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread John Crispin
On 11/03/2016 04:49, Jason Wu wrote: > Hi John, > > There are two scripts that i am thinking about. > > 1. generate fitimage.its that is able to generate mufti-configuration > its file with multiple kernel/dtb/rootfs. One of the benefit of using > python is that it is easier to implement from m

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread Jason Wu
HiJo and Alexandru, Thanks for the input. Cheers, jason On 11/03/2016 7:11 AM, Alexandru Ardelean wrote: On Thu, Mar 10, 2016 at 6:38 PM, Jo-Philipp Wich mailto:j...@openwrt.org>> wrote: Hi Jason, no reason against it per se but it would introduce a new build prereq I suppose.

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread Jason Wu
Hi John, There are two scripts that i am thinking about. 1. generate fitimage.its that is able to generate mufti-configuration its file with multiple kernel/dtb/rootfs. One of the benefit of using python is that it is easier to implement from my point of view. But have to said it can done wit

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread John Crispin
On 10/03/2016 22:11, Alexandru Ardelean wrote: > > > On Thu, Mar 10, 2016 at 6:38 PM, Jo-Philipp Wich > wrote: > > Hi Jason, > > no reason against it per se but it would introduce a new build prereq I > suppose. If possible we'd like to stick to things we

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread Alexandru Ardelean
On Thu, Mar 10, 2016 at 6:38 PM, Jo-Philipp Wich wrote: > Hi Jason, > > no reason against it per se but it would introduce a new build prereq I > suppose. If possible we'd like to stick to things we already require > (perl, awk, shell). > > > Regards, Jo >

Re: [OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread Jo-Philipp Wich
Hi Jason, no reason against it per se but it would introduce a new build prereq I suppose. If possible we'd like to stick to things we already require (perl, awk, shell). Regards, Jo ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https:

[OpenWrt-Devel] Question regarding call python script

2016-03-10 Thread Jason Wu
Dear all, I have a question regarding using a python script (within target/linux/zynq/images/ directory) instead of shell script to handle some scripting work. I am wondering is there any rule against this? Best regards, Jason ___ openwrt-devel mai