luci-app-opkg: fix parsing package dependencies with version constraints

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)
This commit is contained in:
Jo-Philipp Wich 2022-06-03 13:36:02 +02:00
parent 7387ec8e18
commit 1cf976c2b3

View 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();