From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 43B8B138330 for ; Sat, 3 Sep 2016 15:50:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8B4B5E085C; Sat, 3 Sep 2016 15:50:34 +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 E8272E0853 for ; Sat, 3 Sep 2016 15:50:33 +0000 (UTC) Received: from [192.168.0.20] (ip68-5-185-102.oc.oc.cox.net [68.5.185.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id B7BEE340B10 for ; Sat, 3 Sep 2016 15:50:32 +0000 (UTC) Subject: Re: [gentoo-portage-dev] [PATCH] news: Support News-Item-Format 2.0 To: gentoo-portage-dev@lists.gentoo.org References: <20160902204924.6863-1-floppym@gentoo.org> From: Zac Medico Message-ID: <94e0a255-b785-6694-aea5-7017a90f6078@gentoo.org> Date: Sat, 3 Sep 2016 08:50:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <20160902204924.6863-1-floppym@gentoo.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: ad6176d4-40b4-4453-b0fc-4e23300480a8 X-Archives-Hash: db2b957427ef9adf8c4b985fe97c56eb On 09/02/2016 01:49 PM, Mike Gilbert wrote: > Display-If-Installed already supported EAPI 5 atoms. > Use fnmatch for wildcard support on Display-If-Profile. > --- > pym/portage/news.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/pym/portage/news.py b/pym/portage/news.py > index 177f9db..d6d2f07 100644 > --- a/pym/portage/news.py > +++ b/pym/portage/news.py > @@ -271,7 +271,7 @@ class NewsItem(object): > # will never match > format_match = _formatRE.match(line) > if (format_match is not None and > - not fnmatch.fnmatch(format_match.group(1), '1.*')): > + not fnmatch.fnmatch(format_match.group(1), '[12].*')): > invalids.append((i + 1, line.rstrip('\n'))) > break > if not line.startswith('D'): > @@ -325,7 +325,7 @@ class DisplayProfileRestriction(DisplayRestriction): > self.profile = profile > > def checkRestriction(self, **kwargs): > - if self.profile == kwargs['profile']: > + if fnmatch.fnmatch(kwargs['profile'], self.profile): > return True > return False > > Looks good. If we wanted to be more strict about the input that we accept, we could limit the profile wildcard match to so that it only works if the format is 2.* and only supports a terminal /* since that's all that the spec says is supported. -- Thanks, Zac