Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: ulm@g.o
Subject: Re: [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing
Date: Wed, 18 May 2016 15:47:01
Message-Id: 573C8E6E.6010807@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing by Alexander Berntsen
1 On 05/18/2016 01:36 AM, Alexander Berntsen wrote:
2 > Only check the major version of news items, as GLEP 42 specifies an
3 > upgrade path for them. Future revisions to news item formats may yield
4 > minor number increments. GLEP 42 further ensures that only
5 > forwards-compatible changes may incur, as incompatible changes demand a
6 > major version increment.
7 >
8 > Suggested-by: Ulrich Müller <ulm@g.o>
9 > Signed-off-by: Alexander Berntsen <bernalex@g.o>
10 > ---
11 > pym/portage/news.py | 2 +-
12 > 1 file changed, 1 insertion(+), 1 deletion(-)
13 >
14 > diff --git a/pym/portage/news.py b/pym/portage/news.py
15 > index 784ba70..f52d96e 100644
16 > --- a/pym/portage/news.py
17 > +++ b/pym/portage/news.py
18 > @@ -270,7 +270,7 @@ class NewsItem(object):
19 > # Optimization to ignore regex matchines on lines that
20 > # will never match
21 > format_match = _formatRE.match(line)
22 > - if format_match is not None and format_match.group(1) != '1.0':
23 > + if format_match is not None and format_match.group(1) != '1.*':
24 > invalids.append((i + 1, line.rstrip('\n')))
25 > break
26 > if not line.startswith('D'):
27 >
28
29 I think we want to use something like this:
30
31 if (format_match is not None and
32 not fnmatch.fnmatch(format_match.group(1), '1.*')):
33 --
34 Thanks,
35 Zac

Replies