From 3a3a3196aa271e233cae5164dd9f8c9d2c8df12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Andr=C3=A9s=20P=C3=A9rez?= Date: Mon, 27 Apr 2026 21:32:14 +0200 Subject: [PATCH] luci-app-package-manager: handle versioned provides from apk query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'apk query --format json...' outputs the complete provides fields including the version. ... "provides": [ "firewall4-any", "uci-firewall=2025.03.17~b6e51575-r2" ], ... Versus the previous 'apk info --full' ... Package: firewall4 Version: 2025.03.17~b6e51575-r2 Depends: kmod-nft-core, kmod-nft-fib, kmod-nft-nat, kmod-nft-offload, libc, nftables-json, ucode, ucode-mod-fs, ucode-mod-ubus, ucode-mod-uci Provides: firewall4-any, uci-firewall ... Strip the '=' suffix before gathering the providers chain. This was causing some incorrent dependecy issues (ie. uci-firewall not detected as satisfied) in the luci package-manager app. Fixes: https://github.com/openwrt/luci/issues/8563 Fixes: https://github.com/openwrt/luci/issues/8581 Fixes: https://github.com/openwrt/openwrt/issues/23004 Fixes: https://github.com/openwrt/openwrt/issues/23136 Fixes: 1624418f64db1bef1ec8e5fafd42bec63cd0adc0 ("package-manager: migrate to apk-tools JSON API") Signed-off-by: Mario Andrés Pérez --- .../htdocs/luci-static/resources/view/package-manager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/luci-app-package-manager/htdocs/luci-static/resources/view/package-manager.js b/applications/luci-app-package-manager/htdocs/luci-static/resources/view/package-manager.js index e6b1a45e9a..24fa7e37e2 100644 --- a/applications/luci-app-package-manager/htdocs/luci-static/resources/view/package-manager.js +++ b/applications/luci-app-package-manager/htdocs/luci-static/resources/view/package-manager.js @@ -231,7 +231,8 @@ function parseApkQueryJson(s, dest) { // Determine all provided names (a package always provides itself) const provides = [name, ...(Array.isArray(pkg.provides) ? pkg.provides : [])]; - for (const p of provides) { + for (let p of provides) { + p = p.split('=')[0]; // Handle cases where provides are versioned dest.providers[p] = dest.providers[p] || []; if (!dest.providers[p].includes(pkg)) dest.providers[p].push(pkg);