OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by MOZGIII - 02.12.2018

FS#1981 - UCI import -m failes if invoked multiple times without commit

Hello, I’m using somewhat old LEDE, but this does not seem to make deffierence. Correct me if I’m wrong.
I installed fresh version of UCI:

root@router:~# opkg info uci
Package: uci
Version: 2018-08-11-4c8b4d6e-1
Depends: libc, libuci
Status: install user installed
Section: base
Architecture: mips_24kc
Size: 7166
Filename: uci_2018-08-11-4c8b4d6e-1_mips_24kc.ipk
Description: Utility for the Unified Configuration Interface (UCI)
Installed-Time: 1543713053

Now, the bug.
I have a small test file with some `config`s in it. They’re named.
If I do import multiple times it results if an error.

Here’s my shell log that should to reproduce this issue:

root@router:~# uci commit # make sure there’re no pending changes
root@router:~# rm -f /etc/config/import-test # clear the target cofnig file for a clean test
root@router:~# cat import-test # dispay the file we’re about to import
config host ‘a’

option name 'a'

config host ‘b’

option name 'b'

root@router:~# uci changes # demonstrate there’re no pending changes
root@router:~# uci -m import import-test < import-test # invoke the import
root@router:~# uci changes # still no changes after first import
root@router:~# uci -m import import-test < import-test # import import for the second time
root@router:~# uci changes # wow, now there are some changes! this is not expected
import-test.a=’host’ import-test.b=’host’ root@router:~# uci -m import import-test < import-test # call import for the third time - and it fails with an error
uci: Parse error (option/list command found before the first section) at line 2, byte 1

This looks like a bug to me. Thoughts?

MOZGIII commented on 02.12.2018 01:26

A version with corrected formatting

Hello, I'm using somewhat old LEDE, but this does not seem to make deffierence. Correct me if I'm wrong.
I installed fresh version of UCI:

root@router:~# opkg info uci
Package: uci
Version: 2018-08-11-4c8b4d6e-1
Depends: libc, libuci
Status: install user installed
Section: base
Architecture: mips_24kc
Size: 7166
Filename: uci_2018-08-11-4c8b4d6e-1_mips_24kc.ipk
Description: Utility for the Unified Configuration Interface (UCI)
Installed-Time: 1543713053

Now, the bug.
I have a small test file with some `config`s in it. They're named.
If I do import multiple times it results if an error.

Here's my shell log that should to reproduce this issue:

root@router:~# uci commit                           # make sure there're no pending changes
root@router:~# rm -f /etc/config/import-test        # clear the target cofnig file for a clean test
root@router:~# cat import-test                      # dispay the file we're about to import
config host 'a'
	option name 'a'

config host 'b'
	option name 'b'
root@router:~# uci changes                               # demonstrate there're no pending changes
root@router:~# uci -m import import-test < import-test   # invoke the import
root@router:~# uci changes                               # still no changes after first import
root@router:~# uci -m import import-test < import-test   # import import for the second time
root@router:~# uci changes                               # wow, now there are some changes! this is not expected
import-test.a='host'
import-test.b='host'
root@router:~# uci -m import import-test < import-test   # call import for the third time - and it fails with an error
uci: Parse error (option/list command found before the first section) at line 2, byte 1

This looks like a bug to me. Thoughts?

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing