-
Notifications
You must be signed in to change notification settings - Fork 28
libubox: Add anonymous strings, ints, et al in arrays #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
libubox: Add anonymous strings, ints, et al in arrays #12
Conversation
|
@Ansuel Can someone please review this? |
|
cc: @robimarko @neheb @hauke @ynezz |
|
cc: @nbd168 |
|
@i-jonas I thank you for taking the time to diligently review this. |
31a6f71 to
3096a5b
Compare
3096a5b to
83cd4c7
Compare
|
It looks like just results in |
And that's usually the point of convenience functions. They provide a simplified wrapper fro doing something else. As I point out elsewhere, though, there are packages like |
Why are they not implemented as wrappers around the existing functions in the public API like your referenced code examples do it? Why are the new warnings not implemented in a way that code not using the new convenience functions also benefits from it?
Most of your referenced source code parts are domain specific convenience functions that cannot be compared with that. Those that are wrappers are implemented better than your suggestion, e.g. by allowing to add multiple array elements at once. Why does your convenience function not support that?
Instead, its source code bloat. I don't see a difference here.
For me, it does not make a difference. |
No idea. Perhaps they also gave up on making changes to
Sorry, how do you mean? How would that work?
Disagree. My proposed https://github.com/openwrt/netifd/blob/master/scripts/netifd-proto.sh#L240-L242
Then what... we stop adding any new code at all?
How much are you having to write scripting with |
I was saying that the examples you referenced implemented it better than you from my perspective. Now I was asking why you implement it differently?
Take a look at that other implementations. Then think about the call stack.
Disagree with the disagree. The check can be added at another place where it affects all calls, including those using the current public API. See previous point.
Please check the links you provided again. This feels to me like an AI research result that throws links without understanding their content.
No. I just dislike the argument "no bloat because not compiled".
Using another function name to skip one empty argument? This particular thing is not that helpful. I've worked with JSON in OpenWrt in shell scripts and really liked replacing that with ucode. |
All my examples are calling
I've lost the thread. Which other implementations? Can you post a link?
But... that was the point of adding a wrapper called
Are we talking about the links mentioned here? I grepped through the sources and manually copy & pasted those links.
Any new functionality comes with some cost unless it includes serious refactoring to shrink overall size. Even there the cost is risk of introducing new bugs or regressions.
Perhaps but I like having commonality between ISC-DHCP and Kea. Makes it easier for me. |
Yes
I believe that and still made some experiences with junior devs. That's why it feels like that. I was referring to https://github.com/openwrt/openwrt/blob/main/package/system/procd/files/procd.sh#L114 which adds some value over a simple wrapper.
I know. And due to this, one has to balance the advantages and the risks.
How is this related to one isolated script converting the configuration? |
It shares a lot of code with dhcpd.init: the validation of the UCI, the synthesis of the resources records and integration with Bind is all the same. All that's different is the generation of the DHCP configuration target file itself. |
|
Separating out |
Sharing by duplicating? If there would be a third package like dhcp-common containing the shared code, then I would call and consider it sharing. |
But they'll never both be installed at the same time. |
I'm thinking about the source code duplication. You could try to use a symlink within this repository to actually share code between to packages, but the common package sounds cleaner. |
Errors are sent to stderr in all but once place. Signed-off-by: Philip Prindeville <[email protected]>
Use local variables for positional arguments where they're captured, and provide comments for position arguments. Signed-off-by: Philip Prindeville <[email protected]>
83cd4c7 to
2cff3b7
Compare
You can have a "name" in an array member without an associated value. Signed-off-by: Philip Prindeville <[email protected]>
2cff3b7 to
9223a34
Compare
|
Added test coverage and complete scalars |
You can have a "name" in an array member without an associated value.