On 05/18/2016 01:36 AM, Alexander Berntsen wrote:
> 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.
> 
> Suggested-by:  Ulrich Müller      <u...@gentoo.org>
> Signed-off-by: Alexander Berntsen <berna...@gentoo.org>
> ---
>  pym/portage/news.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pym/portage/news.py b/pym/portage/news.py
> index 784ba70..f52d96e 100644
> --- a/pym/portage/news.py
> +++ b/pym/portage/news.py
> @@ -270,7 +270,7 @@ 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 format_match.group(1) 
> != '1.*':
>                               invalids.append((i + 1, line.rstrip('\n')))
>                               break
>                       if not line.startswith('D'):
> 

I think we want to use something like this:

if (format_match is not None and
    not fnmatch.fnmatch(format_match.group(1), '1.*')):
-- 
Thanks,
Zac

Reply via email to