From 55129e390ce34ca85f71a702b0273c1a3fe73cdd Mon Sep 17 00:00:00 2001 From: Hans van Kranenburg Date: Tue, 19 Dec 2017 15:39:14 +0100 Subject: [PATCH] debian/lib/python: Recognize pre / rc versions When tracking the latest upstream versions in Debian unstable, I'd like to keep the packages updated with latest available security patches which are available when working on a new upload. So that means not always working with an exact tagged upstream release. There are two possible approaches when doing this: 1. Use the latest official release as orig tar and keep the rest of the changes in debian patches. This is also what we would do for security updates to stable. 2. Just follow the upstream stable branch lines (they will always fix forward) and keep the latest changes in the orig tar. I think option 2 makes the most sense for uploads to unstable when we're nowhere near to a freeze yet. This results in version numbers like 4.9.2~pre+1.32e364c4e7-1, where the 1 is simply a helper because git commit ids are not sortable. 4.9.1+1.32e364c4e7-1 would also be an option, but since xen will report itself als 4.9.2-pre (e.g. in xen info output), I prefer the ~pre one. When testing new versions that are in rc state upstream, we might put them in the Debian experimental distribution, so that we can find out what needs to be done to the packaging already, and so that we provide the opportunity for Debian users to help testing the new release on their hardware. These versions will usually look like e.g. 4.10~rc8-1~exp1, but incidentally they could also include a few newer corrections, in which case we end up with a git revision again, like seen above, but then with rcX instead of pre and now the second pattern choice, because upstream doesn't let us know if there will be a next rc, or the actual release. So, that would be something like 4.10~rc8+1.3e11e302a8-1~exp1 This change allows both of these version patterns. While only the major.minor version is used from it all, it's a nice sanity checker to prevent eventual mistakes. Allowed: * 4.9.2-1 * 4.9.2~pre+1.32e364c4e7 * 4.10~rc8-1~exp1 * 4.10~rc8+1.3e11e302a8-1~exp1 Not allowed: * 4.10-1 --- debian/lib/python/debian_xen/debian.py | 33 +++++++++----------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/debian/lib/python/debian_xen/debian.py b/debian/lib/python/debian_xen/debian.py index f541494e9a..069d9b2ef5 100644 --- a/debian/lib/python/debian_xen/debian.py +++ b/debian/lib/python/debian_xen/debian.py @@ -4,28 +4,17 @@ from debian_linux.debian import Version class VersionXen(Version): _version_xen_rules = r""" -^ -(?P - \d+\.\d+ -) -(?: - \.\d+ - (?: - ~rc\d+ - )? - (?: - \+hg-\d+.[a-z0-9]+ - )? - (?: - ~pre\.\d{4,}\.\d{2}\.\d{2}(?:\b[-+0-9a-z])? - )? - | - ~hg-\d+.[a-z0-9]+ -) -- -(?:[^-]+) -$ -""" + ^ + (?P\d+\.\d+) + (?: + \.\d+(?:~pre(?:\+\d+\.[0-9a-f]{10}))? + | + ~rc\d+(?:\+\d+\.[0-9a-f]{10})? + ) + - + (?:[^-]+) + $ + """ _version_xen_re = re.compile(_version_xen_rules, re.X) def __init__(self, version): -- 2.30.2