summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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