fixed multipkgs not getting parsed correctly

This commit is contained in:
2021-05-30 18:02:23 +02:00
parent 718906efe6
commit 9f557b9f6b

View File

@@ -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"):