Gentoo Archives: gentoo-portage-dev

From: Mike Gilbert <floppym@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] news: Support News-Item-Format 2.0
Date: Fri, 02 Sep 2016 20:49:30
Message-Id: 20160902204924.6863-1-floppym@gentoo.org
1 Display-If-Installed already supported EAPI 5 atoms.
2 Use fnmatch for wildcard support on Display-If-Profile.
3 ---
4 pym/portage/news.py | 4 ++--
5 1 file changed, 2 insertions(+), 2 deletions(-)
6
7 diff --git a/pym/portage/news.py b/pym/portage/news.py
8 index 177f9db..d6d2f07 100644
9 --- a/pym/portage/news.py
10 +++ b/pym/portage/news.py
11 @@ -271,7 +271,7 @@ class NewsItem(object):
12 # will never match
13 format_match = _formatRE.match(line)
14 if (format_match is not None and
15 - not fnmatch.fnmatch(format_match.group(1), '1.*')):
16 + not fnmatch.fnmatch(format_match.group(1), '[12].*')):
17 invalids.append((i + 1, line.rstrip('\n')))
18 break
19 if not line.startswith('D'):
20 @@ -325,7 +325,7 @@ class DisplayProfileRestriction(DisplayRestriction):
21 self.profile = profile
22
23 def checkRestriction(self, **kwargs):
24 - if self.profile == kwargs['profile']:
25 + if fnmatch.fnmatch(kwargs['profile'], self.profile):
26 return True
27 return False
28
29 --
30 2.9.3

Replies