public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] [PATCH] news: Support News-Item-Format 2.0
Date: Fri,  2 Sep 2016 16:49:24 -0400	[thread overview]
Message-ID: <20160902204924.6863-1-floppym@gentoo.org> (raw)

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
 
-- 
2.9.3



             reply	other threads:[~2016-09-02 20:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 20:49 Mike Gilbert [this message]
2016-09-03 15:50 ` [gentoo-portage-dev] [PATCH] news: Support News-Item-Format 2.0 Zac Medico
2016-09-03 18:27   ` Ulrich Mueller
2016-09-03 22:12   ` Mike Gilbert
2016-09-04 16:58 ` [gentoo-portage-dev] [PATCH v2] " Mike Gilbert
2016-09-04 17:04   ` [gentoo-portage-dev] [PATCH v3] " Mike Gilbert
2016-09-07  7:26     ` Zac Medico
2016-09-07 21:03       ` [gentoo-portage-dev] [PATCH v4] " Mike Gilbert
2016-09-08  0:31         ` Zac Medico
2016-09-08  5:31           ` [gentoo-portage-dev] [PATCH v5] " Mike Gilbert
2016-09-10 22:05             ` Zac Medico
2016-09-07 21:06       ` [gentoo-portage-dev] [PATCH v3] " Mike Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160902204924.6863-1-floppym@gentoo.org \
    --to=floppym@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox