From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-882470-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 59E69138262 for <garchives@archives.gentoo.org>; Fri, 20 May 2016 09:01:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1C052E07DB; Fri, 20 May 2016 09:01:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B5BCDE07DB for <gentoo-commits@lists.gentoo.org>; Fri, 20 May 2016 09:01:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 25CB134045C for <gentoo-commits@lists.gentoo.org>; Fri, 20 May 2016 09:01:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 204A391A for <gentoo-commits@lists.gentoo.org>; Fri, 20 May 2016 09:01:10 +0000 (UTC) From: "Alexander Berntsen" <bernalex@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexander Berntsen" <bernalex@gentoo.org> Message-ID: <1463734820.68ad3c50221023f6919d66a1d07d4976da037552.bernalex@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/news.py X-VCS-Directories: pym/portage/ X-VCS-Committer: bernalex X-VCS-Committer-Name: Alexander Berntsen X-VCS-Revision: 68ad3c50221023f6919d66a1d07d4976da037552 X-VCS-Branch: master Date: Fri, 20 May 2016 09:01:10 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4dc7c0b0-1229-4240-becf-f2b7246d14b2 X-Archives-Hash: 5451fe44ff4e13f65d4ce896a5827cda commit: 68ad3c50221023f6919d66a1d07d4976da037552 Author: Alexander Berntsen <bernalex <AT> gentoo <DOT> org> AuthorDate: Wed May 18 08:24:13 2016 +0000 Commit: Alexander Berntsen <bernalex <AT> gentoo <DOT> org> CommitDate: Fri May 20 09:00:20 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=68ad3c50 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 <AT> gentoo.org> Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org> Acked-by: Zac Medico <zmedico <AT> gentoo.org> pym/portage/news.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pym/portage/news.py b/pym/portage/news.py index 784ba70..ea1b947 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'):