From 54cc784bf550936b311035a4be1f19cad9700df0 Mon Sep 17 00:00:00 2001 From: Jeremy Drake Date: Mon, 17 Feb 2025 16:07:55 +0100 Subject: [PATCH] make-file-list.sh: future-proof the `pactree` output parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In c9f04bbd9 (make-file-list: stop being confused by `>=` in the `pactree` output, 2025-02-10), this script was adjusted to account for `pactree` sometimes specifying version ranges of some dependencies. However, this change was incomplete! It only handles the version ranges that are _currently_ found in Git for Windows, but other version ranges are equally valid. What I came up with to parse a dependency in msys2/pacdb (https://github.com/msys2/pacdb) is: ```source-python _DEPENDRE = re.compile(r'([^<>=]+)(?:(<=|>=|<|>|=)(.*))?') ``` That might be more complicated than we want to use here though. (That gets you 3 match groups: the package name, the relational operator, and the version). We might just as well future-proof it by a simpler solution that nevertheless catches more package version checks. Signed-off-by: Jeremy Drake Signed-off-by: Johannes Schindelin --- make-file-list.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make-file-list.sh b/make-file-list.sh index 3476e84ef7..35fc5aad8e 100755 --- a/make-file-list.sh +++ b/make-file-list.sh @@ -107,7 +107,7 @@ pacman_list () { do pactree -u "$arg" done | - sed 's/>.*//' | + sed 's/[<>=].*//' | grep -v "^\\($(echo $PACKAGE_EXCLUDES | sed \ -e 's/ /\\|/g' \ -e 's/mingw-w64-/&\\(i686\\|x86_64\\|clang-aarch64\\)-/g')\\)\$" |