[OpenWrt-Devel] Parsing list of options with the callback method

Baptiste Jonglez bjonglez at illyse.org
Thu Aug 28 07:14:05 EDT 2014


Ah, I had missed the "list_cb()" callback, which correctly receives each
(key, value) pair in a list.

Still, I don't think receiving "import_table_ITEM1" and
"import_table_LENGTH" in the "option_cb()" is correct.  I'm not sure
whether it comes from this shell script:

  http://git.openwrt.org/?p=openwrt.git;a=blob;f=package/base-files/files/lib/functions.sh;h=0d4b2a33dbbf4e18acd474ae2adaad0ea3c1c4a0;hb=HEAD

or from uci itself.  Any clue?

On Wed, Aug 27, 2014 at 07:11:39PM +0200, Baptiste Jonglez wrote:
> Hi,
> 
> According to [1], it should be possible to parse list of options in a UCI
> file using an "option_cb()" callback.
> 
> It does not seem to work as expected, for instance this block:
> 
> config example
>     list 'import_table' '42'
>     list 'import_table' '53'
> 
> leads to the following calls:
> 
> config_cb example cfg02f223
> option_cb import_table_ITEM1 42
> option_cb import_table_LENGTH 1
> option_cb import_table_ITEM2 53
> option_cb import_table_LENGTH 2
> 
> I would have simply expected multiple calls to option_cb() with
> "import_table" as the first argument and the various value as the second
> argument.  Is this intended?
> 
> Thanks,
> Baptiste
> 
> [1] http://wiki.openwrt.org/doc/devel/config-scripting#callbacks



> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20140828/ecccc7b8/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list