* [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing
@ 2016-05-18 8:36 Alexander Berntsen
2016-05-18 15:46 ` Zac Medico
2016-05-19 10:12 ` [gentoo-portage-dev] [PATCH v2] " Alexander Berntsen
0 siblings, 2 replies; 9+ messages in thread
From: Alexander Berntsen @ 2016-05-18 8:36 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: ulm
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 <ulm@gentoo.org>
Signed-off-by: Alexander Berntsen <bernalex@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'):
--
2.7.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing
2016-05-18 8:36 [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing Alexander Berntsen
@ 2016-05-18 15:46 ` Zac Medico
2016-05-18 16:57 ` Alexander Berntsen
2016-05-18 17:04 ` Alexander Berntsen
2016-05-19 10:12 ` [gentoo-portage-dev] [PATCH v2] " Alexander Berntsen
1 sibling, 2 replies; 9+ messages in thread
From: Zac Medico @ 2016-05-18 15:46 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: ulm
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 <ulm@gentoo.org>
> Signed-off-by: Alexander Berntsen <bernalex@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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing
2016-05-18 15:46 ` Zac Medico
@ 2016-05-18 16:57 ` Alexander Berntsen
2016-05-18 17:04 ` Alexander Berntsen
1 sibling, 0 replies; 9+ messages in thread
From: Alexander Berntsen @ 2016-05-18 16:57 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 18/05/16 17:46, Zac Medico wrote:
> if (format_match is not None and not
> fnmatch.fnmatch(format_match.group(1), '1.*')):
Yes! Sorry! I had made that change, but then forgotten to stage it. So
sorry. It's been hell of a day, so it just slipped past me. I'll get
right to it.
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJXPJ7lAAoJENQqWdRUGk8BK5UQAIjkJMxmoBi2uKGWHNpZ6gvg
X2km6wtokpowTtrTNVRD5zjtJeyhKPa/jkp5EVoka6GbW8Ap/9ykUSR36xxscQ5R
HxWnpP6OPrPS59wpXU+gTRLOwEhLE9gP1WEQFHPCnPwmIasYXZl4BXK/IOU3rblc
PymEa+VvTU2Kg0EdLsnqQ4rHvkBngwykByC64zM3eL3ZoJoO8tmZ8cRByObCYWk/
SJkLp6F/WdWJSmwldS/e+HhgAn0Y7DEKpv3NYpKT3osv+ga4CXaxalToNy+pmwIj
kAC7EqMREBEOAumcitTPKxKtUZhkxm/SJC/+e0BWAvOAWMcP9+pxRmMwTx8wrgym
6zN53g+MFSqYMxwm5Xvy+vIBflfXBiRYFNxs/hGfDLCh5270pHnvYH4V80lS8wQX
InobYnpuwQcvJWN5CiT0kY8fYTgfCE28AIBgPSHO62+Fbmc60v0Fbh7X8KDv1aI7
TPKCldsFuIXj5X3PefGM8/aUq4DE94slGtNSiVrl1c+KKfKRCY6g6XzjYNm2m1i6
cwXldoofl973bNAyV9m3ACntHQXV/Q+/h4imC2lS08Yhb6s8lmsSrozEQqoYbgPN
0c1aFF+maNjDZKH0oDDXhLW2JeKScEan6lyotppiWKImJhqgq+oWVtg3asBx426k
CKOQJdfbZtI0ICBLL5eY
=1ZKx
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing
2016-05-18 15:46 ` Zac Medico
2016-05-18 16:57 ` Alexander Berntsen
@ 2016-05-18 17:04 ` Alexander Berntsen
2016-05-18 19:06 ` Zac Medico
1 sibling, 1 reply; 9+ messages in thread
From: Alexander Berntsen @ 2016-05-18 17:04 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 18/05/16 17:46, Zac Medico wrote:
> not fnmatch.fnmatch(format_match.group(1), '1.*')):
Wait, why "not"?
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJXPKCxAAoJENQqWdRUGk8B7QAP/ixWgI2RU1CBXNLe+77mgxKk
rVtetbPmXyjiWgrkQvayLOVHF5JO4sh7PiH4Qpo75VhFKr48/GuIfYzt3q6b8gNn
GwP0fI0zc/fBoQYaHXI/qjyp+uCcEQAhT2yuvRFat7wRPTgSJKcbk/vsA6Eoof4c
rin3uWiWI5P+vNI7Kbmv7NNFshQ9Ak4J80AZmc+h/H0asj7Va7s/FyhlnXciL4Xh
H4H8SklefZoN+m8gPo90o6ny5PLIlDAtrdsESKXtKqKFX4OFyjkfRn3I7M+Gplki
+zrxDKGK2fYNMsgECS003cGEtnlkF2d9DTUAakCQJadKLPZXJ8kZnissBcmIqwyg
dH+1IhFUHAeBghEfan86x9SEtJ0HIEYEX/zHrknCZDLRtk5V8grlyWjA3bRYtfka
CbX6J4F0hgDPao4WHkUYp6I6NaDJTA9XwyNkX0E+GObCu9GvvdMy87DOFVVkEua9
Hlq6XAyTnMRZ3doh8eS2enDMul1qlng742BQ8D9egc49GxSl6eIZwELDS0QsTkQN
I+KNIB3ktNnxhh4FX+Gp4HPXEtsXNbXzqfNp6AbYcWh/lbH5jVZOYwuU+sJ/Ky/j
76hdj9BmNsncsPvmxxslBjJHq8SKIs3RKs+9HukFN/+zbSpGvkhi5BQQ3Tk+tPZK
Ju6X2kT2Hu3s77Wt6XjX
=t647
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing
2016-05-18 17:04 ` Alexander Berntsen
@ 2016-05-18 19:06 ` Zac Medico
2016-05-18 19:50 ` Alexander Berntsen
0 siblings, 1 reply; 9+ messages in thread
From: Zac Medico @ 2016-05-18 19:06 UTC (permalink / raw
To: gentoo-portage-dev
On 05/18/2016 10:04 AM, Alexander Berntsen wrote:
> On 18/05/16 17:46, Zac Medico wrote:
>> not fnmatch.fnmatch(format_match.group(1), '1.*')):
> Wait, why "not"?
Because this code searches for items which do NOT match the pattern,
which is why the existing code uses a != operator.
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing
2016-05-18 19:06 ` Zac Medico
@ 2016-05-18 19:50 ` Alexander Berntsen
0 siblings, 0 replies; 9+ messages in thread
From: Alexander Berntsen @ 2016-05-18 19:50 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 18/05/16 21:06, Zac Medico wrote:
> Because this code searches for items which do NOT match the
> pattern, which is why the existing code uses a != operator.
OFC. Maybe I should just do this tomorrow... Thank you for being
patient.
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJXPMd2AAoJENQqWdRUGk8BtOMQANh/WkOq5DF7Lpg8mc8vSLKG
rb6m40h8Ma9vm1gBJSEhGUgCiP9y0JGTOODX3mx3uHpJV2jqCPmPedEZT9GQ1BAR
XqqQ7v6kDMtqL61LMi8D+MBDKSIKjhhKhsS6TveqvUa3TnbG611JmUpYUNUOnnjB
YnVt5TWYEiQJt1xknpXsLt7g5ZcEApnyJjcknb7Xt/cBAwb/YUt3YuGC1A7brG9Q
7RGuuP7PunzgO46je56CQTIbZQaho6qbKVHdo58v0YCzv0tsszh080PN/c+CxBai
xs0TCihDVzxr62t4UeX3HiCiN80L34xv3z533uPMn9Drh5lad+NUnqw9EeP+dP3t
B1RzBLRyeMwakd0wc2clSOBSjdcLnWZqRUPzlfYw++m9QfiNgTBed2a1E+Jm9jZV
tzQSmnocFiW7w6g+PeuKQWIsc+rD5PRbQxYvgItYOYXEJ1R3aUQ7PfVKjzSYuAYT
zxXpuZEHhAgw50KWKix69pSjAFdy8DsXt8xLEBga5BcOL3GJ0QhrWwvFGbkuZXz5
Rnz39IMIJ6ShWGro3PJqbLTM3JIwj4arH9ExfEZQ/zNqzU4zODfnr9e2CPWCbpM7
S0ac64Pr5ju4kIF18FLCOD46I18cXCa0TIiEbOrLXePuf7Y4+Bo51WH5lsBBBDKi
Nrb0/1/b8YxLDqTbq4hz
=W/l9
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* [gentoo-portage-dev] [PATCH v2] news.py: Check only for major version when parsing
2016-05-18 8:36 [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing Alexander Berntsen
2016-05-18 15:46 ` Zac Medico
@ 2016-05-19 10:12 ` Alexander Berntsen
2016-05-19 14:37 ` Zac Medico
1 sibling, 1 reply; 9+ messages in thread
From: Alexander Berntsen @ 2016-05-19 10:12 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: ulm
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 <ulm@gentoo.org>
Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
---
pym/portage/news.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pym/portage/news.py b/pym/portage/news.py
index 784ba70..ea1b947 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -9,6 +9,7 @@ __all__ = ["NewsManager", "NewsItem", "DisplayRestriction",
"DisplayInstalledRestriction",
"count_unread_news", "display_news_notifications"]
+import fnmatch
import io
import logging
import os as _os
@@ -270,7 +271,8 @@ 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
+ not fnmatch.fnmatch(format_match.group(1), '1.*')):
invalids.append((i + 1, line.rstrip('\n')))
break
if not line.startswith('D'):
--
2.7.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH v2] news.py: Check only for major version when parsing
2016-05-19 10:12 ` [gentoo-portage-dev] [PATCH v2] " Alexander Berntsen
@ 2016-05-19 14:37 ` Zac Medico
2016-05-20 9:01 ` Alexander Berntsen
0 siblings, 1 reply; 9+ messages in thread
From: Zac Medico @ 2016-05-19 14:37 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: ulm
On 05/19/2016 03:12 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 <ulm@gentoo.org>
> Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
> ---
> pym/portage/news.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/pym/portage/news.py b/pym/portage/news.py
> index 784ba70..ea1b947 100644
> --- a/pym/portage/news.py
> +++ b/pym/portage/news.py
> @@ -9,6 +9,7 @@ __all__ = ["NewsManager", "NewsItem", "DisplayRestriction",
> "DisplayInstalledRestriction",
> "count_unread_news", "display_news_notifications"]
>
> +import fnmatch
> import io
> import logging
> import os as _os
> @@ -270,7 +271,8 @@ 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
> + not fnmatch.fnmatch(format_match.group(1), '1.*')):
> invalids.append((i + 1, line.rstrip('\n')))
> break
> if not line.startswith('D'):
>
Looks good.
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH v2] news.py: Check only for major version when parsing
2016-05-19 14:37 ` Zac Medico
@ 2016-05-20 9:01 ` Alexander Berntsen
0 siblings, 0 replies; 9+ messages in thread
From: Alexander Berntsen @ 2016-05-20 9:01 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Pushed as 68ad3c50221023f6919d66a1d07d4976da037552.
- --
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJXPtJyAAoJENQqWdRUGk8BTlsQALGGBrKfwv3VpCRYnhn+nONx
8U75FF8ZJQetIIa9aZJFTpNXDmizvrbSL0LRIZqaB7Ymd4uQcQcL3l+4CZF/+px5
Opru24HvOLsXwCohsVgMBUrQaa+11IQDicgn81Q+ziM0FYKJrJCSjeX22j5n4M4N
Yj1ieoUYudN2G0k3fhPAI3CADDvGwEH6t8z/C5K4vf+2odE56JUy5vQkJx2UCvI4
xBtdjj8PAx7DZhVvKS0O5bODyhjAJgg6273eKnuJA8NNxa9NQycI3L7/cM+G07Cp
lziIGCBCGZrEbI9kbPbiYNIXYkvlCeUptP9PjAQ30cHbMu3Xt/mQyX+jiX9HZug7
VAseEE5g7wXIqGM7ds7/saGAkHwRarwlT+xHHY0GcOnO3MMUDZmVwGE+JVlejA1p
OerC7Uc/U1llNS4l/HTdmWRr2aabN+gt02xFp7VSDcpougreQmedMI/3YnL6FXGd
qZnLHerkhreCjibHcbacLjHk9uFK6qnUU90Bh8fwcQfn9mYBPMYlfd1Vjuw9ehst
iRhUsT+ezl/MqrIHk7tDTihEV7TfyafV7NofOgJHu2bLzoa8Y1MfxXyxGO9em1/m
iX+suc4e2qwiIGUPI+4yxiil/va5r9S9bUhU/RpGazB7jRyaqKKQV1+4XTzWj5ws
2M1+7vSYPzWhDAJErREB
=wmCB
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-05-20 9:01 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-18 8:36 [gentoo-portage-dev] [PATCH] news.py: Check only for major version when parsing Alexander Berntsen
2016-05-18 15:46 ` Zac Medico
2016-05-18 16:57 ` Alexander Berntsen
2016-05-18 17:04 ` Alexander Berntsen
2016-05-18 19:06 ` Zac Medico
2016-05-18 19:50 ` Alexander Berntsen
2016-05-19 10:12 ` [gentoo-portage-dev] [PATCH v2] " Alexander Berntsen
2016-05-19 14:37 ` Zac Medico
2016-05-20 9:01 ` Alexander Berntsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox