diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-30 01:20:07 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-30 01:20:07 +0000 |
commit | 9679bc26bf6b1d0287623ab1685e0a622cf3621e (patch) | |
tree | 35be6d06f280453b6c2fc049311356768d762c62 /modules | |
parent | 44171fde222868b68a880aec8bb375a1acc0e2fc (diff) |
modules/admin-full: purge indexcache after installing or removing packages
Diffstat (limited to 'modules')
-rw-r--r-- | modules/admin-full/luasrc/controller/admin/system.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua index ff000ab75..399640b52 100644 --- a/modules/admin-full/luasrc/controller/admin/system.lua +++ b/modules/admin-full/luasrc/controller/admin/system.lua @@ -40,6 +40,7 @@ function action_packages() local ipkg = require("luci.model.ipkg") local void = nil local submit = luci.http.formvalue("submit") + local changes = false -- Search query @@ -57,6 +58,7 @@ function action_packages() install = {} end install[url] = 1 + changes = true end -- Do install @@ -64,6 +66,7 @@ function action_packages() for k, v in pairs(install) do void, install[k] = ipkg.install(k) end + changes = true end @@ -72,7 +75,8 @@ function action_packages() if remove then for k, v in pairs(remove) do void, remove[k] = ipkg.remove(k) - end + end + changes = true end @@ -116,7 +120,12 @@ function action_packages() end luci.template.render("admin_system/packages", {pkgs=pkgs, query=query, - install=install, remove=remove, update=update, upgrade=upgrade}) + install=install, remove=remove, update=update, upgrade=upgrade}) + + -- Remove index cache + if changes then + luci.fs.unlink("/tmp/luci-indexcache") + end end function action_backup() |