luci-app-nut: use filesystem dependencies for configuration files
authorJo-Philipp Wich <jo@mein.io>
Sat, 15 Oct 2022 12:18:57 +0000 (14:18 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 15 Oct 2022 12:18:57 +0000 (14:18 +0200)
Don't use uci dependencies for nut related config files as the nut packages
ship with completely commented out uci files. Such files do not satisfy the
uci menu dependencies as those expect at least one section within the file.

To solve this issue, use a regular file dependency on /etc/config/nut_*
instead.

Supersedes: #5964
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-nut/root/usr/share/luci/menu.d/luci-app-nut.json

index e19143eb1bb9dc2e1cf6184f7b98134a02509ac9..64300d57ebf1f93d613b20dbfc465e466ae6cdac 100644 (file)
@@ -6,10 +6,10 @@
                },
                "depends": {
                        "acl": [ "luci-app-nut" ],
-                       "uci": [
-                               { "nut_server": true },
-                               { "nut_monitor": true },
-                               { "nut_cgi": true }
+                       "fs": [
+                               { "/etc/config/nut_server": "file" },
+                               { "/etc/config/nut_monitor": "file" },
+                               { "/etc/config/nut_cgi": "file" }
                        ]
                }
        },
@@ -23,7 +23,7 @@
                        "post": { "cbi.submit": true }
                },
                "depends": {
-                       "uci": { "nut_server": true }
+                       "fs": { "/etc/config/nut_server": "file" }
                }
        },
 
@@ -36,7 +36,7 @@
                        "post": { "cbi.submit": true }
                },
                "depends": {
-                       "uci": { "nut_monitor": true }
+                       "fs": { "/etc/config/nut_monitor": "file" }
                }
        },
 
@@ -49,7 +49,7 @@
                        "post": { "cbi.submit": true }
                },
                "depends": {
-                       "uci": { "nut_cgi": true }
+                       "fs": { "/etc/config/nut_cgi": "file" }
                }
        }
 }