<div dir="ltr"><div>In the latest OpenWrt trunk, I found that config_get has stopped loading uncommitted uci changes from /tmp/.uci. I rely on this behavior, which had worked well for years.</div><div><br></div><div>I found a change[1] in uci that’s responsible.</div><div><br></div><div>The uci change makes uci_add_delta_path() reject any attempt to add ctx->savedir to the delta search path. However, in light of cli.c’s usage[2], there’s a problem: when processing a -P argument, it calls uci_add_delta_path() to add the original value of ctx->savedir to the delta search path before changing ctx->savedir.</div><div><br></div><div>After this change, the uci command-line tool’s -P argument no longer acts as documented. Instead of adding a path to the delta search path, it just sets the default save directory.</div><div><br></div><div>This behavior change appears to be unintentional, and as I mentioned, it’s broken a long-standing behavior that I rely on.</div><div><br></div><div>This change became a part of OpenWrt at r45040[3] and is exposed to scripts that use /lib/functions.sh: that script sets LOAD_STATE=1, and its config_load calls /lib/config/uci.sh’s uci_load, which adds a -P argument to its “uci export” command when LOAD_STATE is nonempty.</div>
<div><br></div><div>I’m happy to contribute a patch, but I’m not sure what [1] intended, so I’m e-mailing to raise awareness first.</div><div><br></div><div>Mark</div><div><br></div><div>[1] <a href="http://nbd.name/gitweb.cgi?p=uci.git;a=commitdiff;h=32815cf4959c">http://nbd.name/gitweb.cgi?p=uci.git;a=commitdiff;h=32815cf4959c</a><br></div><div>[2] <a href="http://nbd.name/gitweb.cgi?p=uci.git;a=blob;f=cli.c;h=557472ecf421;hb=HEAD">http://nbd.name/gitweb.cgi?p=uci.git;a=blob;f=cli.c;h=557472ecf421;hb=HEAD</a></div><div>[3] <a href="https://dev.openwrt.org/changeset/45040/trunk">https://dev.openwrt.org/changeset/45040/trunk</a></div></div>