From 66c2bbc2790813a7889c0dd329131e5012fc83dd Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 4 Jan 2019 09:15:49 +0100 Subject: luci-app-opkg: only show packages with higher version in upgrade tab Fixes #2422. Signed-off-by: Jo-Philipp Wich --- applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'applications/luci-app-opkg/htdocs/luci-static/resources/view') diff --git a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js index 274a982929..4a36b0a3c3 100644 --- a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js +++ b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js @@ -135,7 +135,7 @@ function display(pattern) if (currentDisplayMode === 'updates') { var avail = packages.available.pkgs[name]; - if (!avail || avail.version === pkg.version) + if (!avail || compareVersion(avail.version, pkg.version) <= 0) continue; ver = '%s ยป %s'.format( @@ -291,6 +291,9 @@ function compareVersion(val, ref) val = val || ''; ref = ref || ''; + if (val === ref) + return 0; + while (vi < val.length || ri < ref.length) { var first_diff = 0; -- cgit v1.2.3