luci-app-opkg: fix parsing package dependencies with version constraints
authorJo-Philipp Wich <jo@mein.io>
Fri, 3 Jun 2022 11:36:02 +0000 (13:36 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 3 Jun 2022 11:38:14 +0000 (13:38 +0200)
Due to improper ordering of regexp alternatives, version constraint operators
might get undermatched.

Fixes: https://github.com/openwrt/openwrt/issues/9982
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b84791bd029c2aaa67cbc06a15d23828f62f4608)

applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js

index 69b69be9b9364cc4c1e3101209936e8038d3f2fb..a019b2cc318a11260b74a032fea9b82ad2f7d592 100644 (file)
@@ -571,7 +571,7 @@ function renderDependencies(depends, info)
                if (deps[i] === 'libc')
                        continue;
 
-               if (deps[i].match(/^(.+)\s+\((<=|<|>|>=|=|<<|>>)(.+)\)$/)) {
+               if (deps[i].match(/^(.+)\s+\((<=|>=|<<|>>|<|>|=)(.+)\)$/)) {
                        dep = RegExp.$1.trim();
                        vop = RegExp.$2.trim();
                        ver = RegExp.$3.trim();