luci-app-package-manager: support new APK repositories.d configs master openwrt-24.10 7400/head
authorChristian Marangi <ansuelsmth@gmail.com>
Sat, 16 Nov 2024 17:16:20 +0000 (18:16 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Sun, 17 Nov 2024 13:50:11 +0000 (14:50 +0100)
Support new APK repositories.d configs following OPKG was to better
split distfeeds and customfeeds.

Support for ""legacy"" repositories is kept to support migration period
and to support custom scenario where user use this file instead.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
applications/luci-app-package-manager/htdocs/luci-static/resources/view/package-manager.js
applications/luci-app-package-manager/root/usr/share/rpcd/acl.d/luci-app-package-manager.json

index 380ee76d8241bf4540fe252eba32362a77a717b5..d79ee985c9d51c3955739ad649bd274446d1476c 100644 (file)
@@ -865,8 +865,13 @@ function handleConfig(ev)
        fs.list(base_dir).then(function(partials) {
                var files = [];
 
-               if (!L.hasSystemFeature('apk'))
-                       files.push(base_dir + '.conf')
+               if (L.hasSystemFeature('apk')) {
+                        files.push(base_dir + '/' + 'repositories.d/customfeeds.list',
+                                   base_dir + '/' + 'repositories.d/distfeeds.list'
+                        )
+                } else {
+                        files.push(base_dir + '.conf')
+                }
 
                for (var i = 0; i < partials.length; i++) {
                        if (partials[i].type == 'file') {
index e4212389597dbb1385f0e86cff48a8de6bd1e8a8..8d551860e892f11656110178cbb35db10c40676c 100644 (file)
@@ -8,7 +8,9 @@
                                "/usr/libexec/package-manager-call list-available": [ "exec" ],
                                "/etc/opkg.conf": [ "read" ],
                                "/etc/opkg/*.conf": [ "read" ],
-                               "/etc/apk/repositories": [ "read" ]
+                               "/etc/apk/repositories": [ "read" ],
+                               "/etc/apk/repositories.d/distfeeds.list": [ "read" ],
+                               "/etc/apk/repositories.d/customfeeds.list": [ "read" ]
                        },
                        "ubus": {
                                "luci": [ "getMountPoints" ]
@@ -25,6 +27,8 @@
                                "/etc/opkg.conf": [ "write" ],
                                "/etc/opkg/*.conf": [ "write" ],
                                "/etc/apk/repositories": [ "write" ],
+                               "/etc/apk/repositories.d/distfeeds.list": [ "write" ],
+                               "/etc/apk/repositories.d/customfeeds.list": [ "write" ],
                                "/tmp/upload.ipk": [ "write" ],
                                "/tmp/upload.apk": [ "write" ]
                        }