From 4d67ad92fe2c8a32d4e3388ec7f88148c8b454cd Mon Sep 17 00:00:00 2001 From: Papoteur Date: Mon, 8 Jan 2024 10:37:47 +0100 Subject: Fix analyze of repo from mgarepo rpmlog --- mga-advisor.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mga-advisor.py b/mga-advisor.py index 0475873..bd50ef5 100644 --- a/mga-advisor.py +++ b/mga-advisor.py @@ -307,15 +307,20 @@ class Widget(QWidget): source['package'] = package source["version"] = version source["release"] = release + first = True for line in p.stdout.split('\n'): - analyze = re.search(r"^\*.*\s(\w*[\.\d]+)-([\.\d]+).mga\d*(.*)", line) - if analyze is not None: - if analyze.group(3): - source["repo"] = analyze.group(3)[1:] - else: - source["repo"] = "core" - sources.append(source) - break + # Skip the first one which is badly formatted by mgarepo rpmlog + if first: + first = False + else: + analyze = re.search(r"^\*.*\s(\w*[\.\d]+)-([\.\d]+).mga\d*(.*)", line) + if analyze is not None: + if analyze.group(3): + source["repo"] = analyze.group(3)[1:] + else: + source["repo"] = "core" + sources.append(source) + break return sources -- cgit v1.2.1