luci-base: dispatcher.lua: fix filesystem dependency checks
authorJo-Philipp Wich <jo@mein.io>
Thu, 30 Jan 2020 11:19:27 +0000 (12:19 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 7 May 2020 17:40:49 +0000 (19:40 +0200)
A variable clash led to declarative `fs` dependencies being ineffective.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7cfce565530cbf6103275002ad20af57a509ad7b)

modules/luci-base/luasrc/dispatcher.lua

index 32d34da012db296345dd956620d4b16c2a998a69..72884b72240b033bfd158f09cac68b395dd09f38 100644 (file)
@@ -17,10 +17,10 @@ _M.fs = fs
 -- Index table
 local index = nil
 
-local function check_fs_depends(fs)
+local function check_fs_depends(spec)
        local fs = require "nixio.fs"
 
-       for path, kind in pairs(fs) do
+       for path, kind in pairs(spec) do
                if kind == "directory" then
                        local empty = true
                        for entry in (fs.dir(path) or function() end) do