From 9f557b9f6b5002f6c380f90b5c049711a474d996 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Sun, 30 May 2021 18:02:23 +0200 Subject: [PATCH] fixed multipkgs not getting parsed correctly --- master.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/master.py b/master.py index 8827be4..a77c4c9 100644 --- a/master.py +++ b/master.py @@ -23,6 +23,7 @@ regex_pkgrel = re.compile(r"^pkgrel\s*=\s*(.+)$", re.MULTILINE) regex_epoch = re.compile(r"^epoch\s*=\s*(.+)$", re.MULTILINE) regex_march = re.compile(r"(-march=)(.+?) ", re.MULTILINE) regex_validkeys = re.compile(r"^validpgpkeys\+?=\((.*?)\)", re.MULTILINE | re.DOTALL) +regex_pkg_repo = re.compile(r"^(.*)-.*-.*-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$", re.MULTILINE) fp = None update_last = time.time() copy_l = Lock() @@ -150,8 +151,16 @@ def already_running() -> bool: def find_all_files_for_pkg(name: str, repo: str) -> list: - searchpath = os.path.join(config["basedir"]["repo"], repo, "os", config["arch"]) + "/" + name + "-*.pkg.*" - pkgs = glob.glob(searchpath) + pkgs = [] + for root, dirs, files in os.walk(os.path.join(config["basedir"]["repo"], repo, "os", config["arch"])): + for file in files: + res = regex_pkg_repo.match(file) + if res: + if res.group(1) is name: + pkgs.append(os.path.join(root, file)) + + # searchpath = os.path.join(config["basedir"]["repo"], repo, "os", config["arch"]) + "/" + name + "-*.pkg.*" + # pkgs = glob.glob(searchpath) for p in pkgs: if p.endswith(".sig"):