Revert "Redesigned firmware upgrade process"
[project/luci.git] / modules / admin-mini / luasrc / controller / mini / system.lua
index be6cdb6..6d16ef8 100644 (file)
@@ -105,7 +105,9 @@ function action_upgrade()
        local keepcfg = keep_avail and luci.http.formvalue("keepcfg")
 
        if plat and fname then
-               ret = luci.sys.flash(tmpfile, keepcfg and _keep_pattern())
+               ret = function()
+                       return luci.sys.flash(tmpfile, keepcfg and _keep_pattern())
+               end
        end
 
        luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
@@ -113,7 +115,7 @@ end
 
 function _keep_pattern()
        local kpattern = ""
-       local files = luci.model.uci.get_all("luci", "flash_keep")
+       local files = luci.model.uci.cursor():get_all("luci", "flash_keep")
        if files then
                kpattern = ""
                for k,v in pairs(files) do
@@ -121,4 +123,4 @@ function _keep_pattern()
                end
        end
        return kpattern
-end
\ No newline at end of file
+end