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