<jow_>
if you need higher level logic, consider using the rpc uci api
<hgl>
jow_: hmm, you can return early with just config_foreach? doesn't it only use eval and the return status won't prevent "for" from continuing to loop?
<stintel>
Ansuel: would it be a lot of work to add a summary to the channel analysis page that says the number of networks found? or number the networks alternatively?
<hgl>
jow_: is this documented anywhere?
<jow_>
hgl: ah yes, I misremembered the early abort, this baheaviour is present in the Lua and ucode bindings, not the shell API
<jow_>
it will always loop all sections
<jow_>
the overhead is neglectible though (unless you perform expensive work in the callback *before* checking the section it's invoked for)
<hgl>
sometimes there are multiple matches and you might want the first
<hgl>
in this case return early could help
<jow_>
true. I fear that changing it now could be problematic though
<jow_>
since the return value will be the implict result of the last expression in the function
<jow_>
and there might be existing, working code resulting in a callback return value != 0
<hgl>
yeah, so i used a different function name, config_find, shouldn't affect existing code
<hgl>
the rpc api is really cool though
djfe_ has joined #openwrt-devel
maciekb has quit [Read error: Connection reset by peer]
maciekb has joined #openwrt-devel
<hgl>
jow_: do you happen to know which file contains the source for operator like "match" that I can find the rest supported operators?
<hgl>
i skimmed ubus and uci's source code, couldn't surface any
<hgl>
doesn't see to set foo to bar in /etc/config/network
<f00b4r0>
jow_: silly question, I'm learning ucode. I'm loading a config section with uci.get_all() and when I try to print it out, the resulting dictionary is cut (i.e. output stops without proper object termination) at the first "list" element, is this expected?
* f00b4r0
is most likely doing something stupid
<f00b4r0>
hmm scratch that, it seems I was just exhausting some buffer
<jow_>
hgl: you might need to call `ubus call uci commit '{ "config": "network" }'`
<jow_>
hgl: otherwise the changes are just staged
<jow_>
like after "uci set" on the cli
<jow_>
f00b4r0: no, not expected, it should always (try to) print the entire JSON data
<hgl>
jow_: oh, i see. yeah it works now
schwicht has joined #openwrt-devel
<hgl>
jow_: one more quick question, does ucode have ip manipulation functions?
<jow_>
hgl: no, just iptoarr() & arrtoip()
<hgl>
like returning the second IP address from a cidr
<jow_>
I would make sense to port that to ucode (replace Lua API calls with ucode calls)
<jow_>
minus the netlink parts, those are well covered by ucode-mod-rtnl already
<f00b4r0>
jow_: i also can't help but notice you have a lot of code in fw4.uc that seems pretty generic for parsing uci configs and could be used elsewhere ;)
<jow_>
f00b4r0: yes, there'll be truncation
<jow_>
f00b4r0: make sure that you append a newline
<f00b4r0>
I did
tidalf has joined #openwrt-devel
<jow_>
you can pretty-print the data by filtering it through sprintf('%.J\n', ...)
<f00b4r0>
noted, thx
<hgl>
jow_: btw, green light or red light on config_find?
<jow_>
f00b4r0: as for uci parsing, yes - I keep redoing the "define a dict of known options + formats, then read uci according to it" logic in various projects
<jow_>
f00b4r0: problem is generalizing it enough, wrt. supported data formats etc.
<jow_>
s/data formats/option value formats/
<jow_>
without overengineering it
<f00b4r0>
jow_: I'd make what's in fw4 available for inclusion and if stuff happens to be missing there for others I'm sure you'll get patches :)
<jow_>
hgl: not sure really, it seems like a 90% copy of config_foreach()
<jow_>
hgl: maybe just add a config_foreach_ex() that does the very same as config_foreach() but stops when $? of callback is != 0
<jow_>
I also don't particularily like the subshell usage of config_find
<f00b4r0>
I'm trying to handle the case where an option is set as "option" or "list" and I'm sure i'm doing it very stupidly. Not knowing ES probably doesn't help either :)
<jow_>
it does not appear to fit well into the rest of the code which uses variable references
<f00b4r0>
and I see you've got all that sorted out already in fw4
<hgl>
jow_: I see, config_foreach_ex sounds reasonable. are there other places where the _ex convention is used?
<jow_>
hgl: not in openwrt itself, I just know it from various other projects, e.g. libjson-c
<hgl>
ok, I'll update the PR
<jow_>
it's just my opinion though, maybe nbd has another
<jow_>
maybe we can even keep the original config_foreach() and simply implement a new method config_foreach_stop() which callbacks can invoke
<jow_>
that procedure would set a private sentinel-variable which causes the iterator loop in config_foreach() to stop
<hgl>
you mean change config_foreach, so it uses an internal variable like __stop?
<f00b4r0>
but it's good to know the differences when googling for things :)
<jow_>
hgl: the newline stripping you mention likely depends on context
<hgl>
i know it's meant to make foreach work in a recipe, but $(sep) seems to be a noop here
<jow_>
it might not happen in certain contexts
<jow_>
or it only happens on evlauation
<hgl>
oh, I don't know it could be controlled
<jow_>
I think it is like in shell
<jow_>
$(foo) will collapse and strip whitespace
<jow_>
"$(foo)" will not
<jow_>
similar semantics are present in GNU make for sure
<hgl>
I'm trying to do something similar in a package's Makefile, and the sep trick doesn't seem to work for me
<hgl>
become foreach inject space between items
<jow_>
like foo:=<space char> will result in an empty $(foo) but foo:=$(empty)<space char>$(empty) not
<jow_>
hgl: likely depends o nthe calling context
<jow_>
something higher up in the call hierarchy probably collapses it
<jow_>
maybe even an obvious $(strip ...) call
<hgl>
oh ok, guess I can't directly use it in a package Makefile
MaxSoniX has joined #openwrt-devel
<hgl>
jow_: i see how config_foreach_stop works, yeah, that's even better, no need to introduce another loop struct
<hgl>
jow_: what about config_foreach_break?
<jow_>
hgl: even better
<jow_>
or config_foreach_return
<jow_>
could maybe even be used to override the return value of the config_foreach() call
<hgl>
config_foreach_return doesn't seem to suggest you can break the loop
<jow_>
right, breakthen
<jow_>
bbl
<oliv3r[m]>
anybody know how I can 'disable' an 'okay' property, if my driver detects something wrong with it? I suppose it's just a text property without much meaning outside my driver, but it seems like the right thing to do
maciekb has quit [Read error: Connection reset by peer]
maciekb has joined #openwrt-devel
<hgl>
jow_: PR updated and tested. I added dashes to the signal variable in case the user function overwrites it
tidalf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<castiel652>
I got a really stupid compile error at work today. was compiling Python and then it complained about date. Changed my date format settings and it works LOL
<mrkiko>
castiel652: maybe you can report that if suitable?
<castiel652>
mrkiko I will try to reproduce that when I am in the office tomorrow :)
<mrkiko>
castiel652: thanks!
G10h4ck has joined #openwrt-devel
floof58 is now known as Guest1135
floof58 has joined #openwrt-devel
Guest1135 has quit [Ping timeout: 480 seconds]
dgcampea has quit [Remote host closed the connection]
dgcampea has joined #openwrt-devel
G10h4ck_ has joined #openwrt-devel
G10h4ck has quit [Ping timeout: 480 seconds]
castiel652 has quit [Quit: Leaving]
danitool has quit [Quit: Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos]
danitool has joined #openwrt-devel
fakuivan_ has quit [Remote host closed the connection]
fakuivan has joined #openwrt-devel
cbeznea has quit [Read error: Connection reset by peer]
cbeznea has joined #openwrt-devel
maciekb has quit [Read error: Connection reset by peer]
maciekb has joined #openwrt-devel
rua has quit [Ping timeout: 480 seconds]
rua has joined #openwrt-devel
djfe_ is now known as djfe
Ansuel has quit [Ping timeout: 480 seconds]
schwicht has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cmonroe has quit [Read error: Connection reset by peer]
cmonroe has joined #openwrt-devel
Ansuel has quit []
Ansuel has joined #openwrt-devel
G10h4ck_ has quit [Ping timeout: 480 seconds]
Lynx- has joined #openwrt-devel
<Lynx->
can anyone advise how to ensure script terminated in procd context results in 'service X status' showing 'inactive' rather than 'running'?
<oliv3r[m]>
any of you subscribed to the busybox mailing list by any chance?
<oliv3r[m]>
I just sent out something an hour ago; but cant' see it in the archives
<oliv3r[m]>
probably takes a while; i get that, but always curious to see if a mail goes through :)
<slh>
"Only subscribers to the BusyBox mailing list are allowed to post to this list." did you subscribe before?
bluew has joined #openwrt-devel
<oliv3r[m]>
hah, i did not; but did not get a rejection either
<oliv3r[m]>
stupid registrations; i'll deal with that tomorrow then; thanks for that
EsdiDude has joined #openwrt-devel
MaxSoniX has quit [Quit: Konversation terminated!]
mo has joined #openwrt-devel
<EsdiDude>
Hello everyone. I'm trying to get a port going to a Dlink 868L. I got a boost thanks to Quarky's work back in 2017 - see https://github.com/quarkysg/openwrt/commits/lede-17.01-northstar. So I adapted the code the latest branch, compiled, got it flashed from stock - however.. I'm hitting a CodeReal: invalid data followed by a lzma decompress fail: -2
<mo>
i really need help from someone that can point me to a firmware for my device. Its the Wavlink WL-WN570HN2
<EsdiDude>
I put the bootlog on https://pastebin.com/5gmAUtQF - I'm looking for pointers on what might be the issue there.
<Slimey>
EsdiDude you booting from flash or initramfs?
<EsdiDude>
Smiley, the 860L "B" version is based on a ramips chipset, so the loader is probably different
robimarko-temp has joined #openwrt-devel
robimarko-temp has quit []
<EsdiDude>
The 868L is based on a broadcom chipset, which makes life more challenging.
EsdiDude_ has joined #openwrt-devel
EsdiDude has quit [Read error: Connection reset by peer]
EsdiDude__ has joined #openwrt-devel
EsdiDude_ has quit [Ping timeout: 480 seconds]
Lynx- has quit [Remote host closed the connection]
<jow_>
Ansuel: you plan to add -Werror by default?
<jow_>
don't think it's a good idea
<jow_>
future gcc updates will keep introducing new warnings in code that was perfectly fine before
<jow_>
and fixing it for those future versions might break it on older ones
Tapper has quit [Quit: Tapper]
<jow_>
ah, for the kernel
Tapper has joined #openwrt-devel
<Ansuel>
jow just for the kernel not for every package
<Ansuel>
we can sustain clean code on kernel on package it's impossible
philipp64 has quit [Ping timeout: 480 seconds]
schwicht has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
philipp64 has joined #openwrt-devel
floof58 is now known as Guest1165
floof58 has joined #openwrt-devel
Guest1165 has quit [Ping timeout: 480 seconds]
<djfe>
When will we drop support for 8/32 devices like the Asus RT-N11P B1?
<djfe>
(or set them to source-only or something)
guidosarducci has quit [Remote host closed the connection]
guidosarducci has joined #openwrt-devel
guidosarducci has quit [Remote host closed the connection]
Tapper has quit [Quit: Tapper]
svanheule has quit [Ping timeout: 480 seconds]
<slh>
djfe: support for devices with 32 MB RAM has already been discontinued, even if there still are the images around - and if you look deeper, you may also still find images for devices with 16 MB RAM - just that those will crash and burn while booting
guidosarducci has joined #openwrt-devel
danitool has quit [Remote host closed the connection]