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 91B0C138331 for ; Fri, 18 May 2018 19:46:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E735E0982; Fri, 18 May 2018 19:46:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5284BE08CE for ; Fri, 18 May 2018 19:46:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 21C70335C74 for ; Fri, 18 May 2018 19:46:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 439842A1 for ; Fri, 18 May 2018 19:46:09 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1526672430.38cc817c5cecee61407ce78165c7eaebc1634664.grobian@gentoo> Subject: [gentoo-commits] proj/portage:prefix commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/versions.py X-VCS-Directories: pym/portage/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 38cc817c5cecee61407ce78165c7eaebc1634664 X-VCS-Branch: prefix Date: Fri, 18 May 2018 19:46:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 39a7b95f-bb88-48c0-9553-26adad24edd6 X-Archives-Hash: cb1dba4a33aac88069561003c7277e4c commit: 38cc817c5cecee61407ce78165c7eaebc1634664 Author: Fabian Groffen gentoo org> AuthorDate: Fri May 18 19:40:30 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri May 18 19:40:30 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=38cc817c versions: change inter-revisions not to require a leading 0 There is need by some for being able to version ebuilds shadowed from the main tree, so we drop the special flagging from this feature to make it more general consumptive. pym/portage/versions.py | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pym/portage/versions.py b/pym/portage/versions.py index 7f75d1cc9..0b1d50e7c 100644 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@ -51,8 +51,8 @@ _pkg = { } _v = r'(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)' -# PREFIX_LOCAL hack: -r(\d+) -> -r(\d+|0\d+\.\d+) (see below) -_rev = r'(\d+|0\d+\.\d+)' +# PREFIX_LOCAL hack: -r(\d+) -> -r(\d+|\d+\.\d+) (see below) +_rev = r'(\d+|\d+\.\d+)' # END_PREFIX_LOCAL _vr = _v + '(-r(' + _rev + '))?' @@ -254,16 +254,22 @@ def vercmp(ver1, ver2, silent=1): # PREFIX_LOCAL # The suffix part is equal too, so finally check the revision - # Prefix hack: a revision starting with 0 is an 'inter-revision', - # which means that it is possible to create revisions on revisions. - # An example is -r01.1 which is the first revision of -r1. Note - # that a period (.) is used to separate the real revision and the - # secondary revision number. This trick is in use to allow revision - # bumps in ebuilds synced from the main tree for Prefix changes, - # while still staying in the main tree versioning scheme. + # Prefix hack: historically a revision starting with 0 was an + # 'inter-revision', which means that it is possible to create + # revisions on revisions. An example is -r01.1 which is the + # first revision of -r1. Note that a period (.) is used to + # separate the real revision and the secondary revision number. + # In the current state, the leading 0 is no longer used, and + # versions just can have a dot, which means the version is an + # inter-revision. + # This trick is in use to allow revision bumps in ebuilds synced + # from the main tree for Prefix changes, while still staying in + # the main tree versioning scheme. As such it can be used in + # any other overlay where ebuilds from the another tree are + # shadowed. if match1.group(9): - if match1.group(9)[0] == '0' and '.' in match1.group(9): - t = match1.group(9)[1:].split(".") + if '.' in match1.group(9): + t = match1.group(9).split(".") r1 = int(t[0]) r3 = int(t[1]) else: @@ -273,8 +279,8 @@ def vercmp(ver1, ver2, silent=1): r1 = 0 r3 = 0 if match2.group(9): - if match2.group(9)[0] == '0' and '.' in match2.group(9): - t = match2.group(9)[1:].split(".") + if '.' in match2.group(9): + t = match2.group(9).split(".") r2 = int(t[0]) r4 = int(t[1]) else: