Opened 5 years ago

Last modified 4 years ago

#13847 new defect

uci_add_delta_path causes unwanted commit

Reported by: Russ Gardenar <russgardenar@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: UCI Cc:


While trying to write a Lua script for UCI I encountered following problem:
When I create a cursor and add /var/state as delta path, setting something using this cursor and committing has an unwanted side effect. After the commit everything in the /var/state delta file has been committed.

When I check the code of UCI, the documentation for uci_add_delta_path reads “…This function allows you to add directories, which contain 'overlays' for the active config, that will never be committed.” This would mean the side effect should not occur and leads me to believe an error exists in the UCI code (or this documentation needs to be updated).

The following scenario on the cli reproduces my problem:

  • touch /etc/config/test
  • uci add test asection
  • uci set test.@asection[0].option1=w
  • uci set test.@asection[0].option2=x
  • uci commit test
  • uci set test.@asection[0].option3=y
  • uci set test.@asection[0].option4=z
  • mv /tmp/.uci/test /var/state

You now have a config change file in /var/state that you don’t want to commit (compare 'uci show test' with 'uci –p /var/state show test')

  • uci -p /var/state set test.@asection[0].option1=w2
  • uci -p /var/state commit test
  • uci show test

All the entries of the delta file are now in the config file. (I’ve added a full trace of this scenario in attachment.)

Best regards,

Attachments (1)

UCI.txt (1.7 KB) - added by Russ Gardenar <russgardenar@…> 5 years ago.
full trace of UCI cli scenario

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by Russ Gardenar <russgardenar@…>

full trace of UCI cli scenario

comment:1 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

as new .

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.