summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2024-01-08 10:37:47 +0100
committerPapoteur <papoteur@mageia.org>2024-01-08 10:37:47 +0100
commit4d67ad92fe2c8a32d4e3388ec7f88148c8b454cd (patch)
tree2294cd53991edfcd88286b66749bafd96a74b19f
parent4ff7c4d41be8426a433abfe7d7788121daa11894 (diff)
downloadmga-advisor-4d67ad92fe2c8a32d4e3388ec7f88148c8b454cd.tar
mga-advisor-4d67ad92fe2c8a32d4e3388ec7f88148c8b454cd.tar.gz
mga-advisor-4d67ad92fe2c8a32d4e3388ec7f88148c8b454cd.tar.bz2
mga-advisor-4d67ad92fe2c8a32d4e3388ec7f88148c8b454cd.tar.xz
mga-advisor-4d67ad92fe2c8a32d4e3388ec7f88148c8b454cd.zip
Fix analyze of repo from mgarepo rpmlog
-rw-r--r--mga-advisor.py21
1 files 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