luci-0.9: flush stdout during sysupgrade
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 27 Mar 2010 02:02:51 +0000 (02:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 27 Mar 2010 02:02:51 +0000 (02:02 +0000)
modules/admin-full/luasrc/controller/admin/system.lua
modules/admin-mini/luasrc/controller/mini/system.lua

index 75f06f9..6f2279d 100644 (file)
@@ -244,6 +244,7 @@ function action_upgrade()
                if has_platform and has_image and has_support then
                        -- Mimetype text/plain
                        luci.http.prepare_content("text/plain")
+                       luci.http.write("Starting luci-flash...\n")
 
                        -- Now invoke sysupgrade
                        local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
@@ -256,6 +257,7 @@ function action_upgrade()
                                        local ln = fd:read("*l")
                                        if not ln then break end
                                        luci.http.write(ln .. "\n")
+                                       io.flush()
                                end
                                fd:close()
                        end
index 075f51e..481fbf0 100644 (file)
@@ -151,6 +151,7 @@ function action_upgrade()
                if has_platform and has_image and has_support then
                        -- Mimetype text/plain
                        luci.http.prepare_content("text/plain")
+                       luci.http.write("Starting luci-flash...\n")
 
                        -- Now invoke sysupgrade
                        local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
@@ -163,6 +164,7 @@ function action_upgrade()
                                        local ln = fd:read("*l")
                                        if not ln then break end
                                        luci.http.write(ln .. "\n")
+                                       io.flush()
                                end
                                fd:close()
                        end