aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Berntsen <bernalex@gentoo.org>2016-05-18 10:24:13 +0200
committerAlexander Berntsen <bernalex@gentoo.org>2016-05-20 11:00:20 +0200
commit68ad3c50221023f6919d66a1d07d4976da037552 (patch)
tree9105c38c0d240fb1f9e02638069ab6a8ca4be47d
parentdispatch-conf: fix popen UnicodeDecode error (bug 576788) (diff)
downloadportage-68ad3c50221023f6919d66a1d07d4976da037552.tar.gz
portage-68ad3c50221023f6919d66a1d07d4976da037552.tar.bz2
portage-68ad3c50221023f6919d66a1d07d4976da037552.zip
news.py: Check only for major version when parsing
Only check the major version of news items, as GLEP 42 specifies an upgrade path for them. Future revisions to news item formats may yield minor number increments. GLEP 42 further ensures that only forwards-compatible changes may incur, as incompatible changes demand a major version increment. X-Gentoo-Bug: 583560 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=583560 Suggested-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Alexander Berntsen <bernalex@gentoo.org> Acked-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--pym/portage/news.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/news.py b/pym/portage/news.py
index 784ba7053..ea1b9477e 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -9,6 +9,7 @@ __all__ = ["NewsManager", "NewsItem", "DisplayRestriction",
"DisplayInstalledRestriction",
"count_unread_news", "display_news_notifications"]
+import fnmatch
import io
import logging
import os as _os
@@ -270,7 +271,8 @@ class NewsItem(object):
# Optimization to ignore regex matchines on lines that
# will never match
format_match = _formatRE.match(line)
- if format_match is not None and format_match.group(1) != '1.0':
+ if (format_match is not None and
+ not fnmatch.fnmatch(format_match.group(1), '1.*')):
invalids.append((i + 1, line.rstrip('\n')))
break
if not line.startswith('D'):