debian/lib/python: Again fix recognizing versions
authorHans van Kranenburg <hans@knorrie.org>
Sun, 8 Jul 2018 21:54:35 +0000 (23:54 +0200)
committerHans van Kranenburg <hans@knorrie.org>
Sun, 29 Jul 2018 01:51:53 +0000 (03:51 +0200)
commit588cbf49df0550aa6de5ab5ea23487acf3d05c13
tree5644a2a64bf32380d0e97be68e1b2ba7e85a0cf8
parent69ec2bb691ce13754442c5db572ae0c7256cb046
debian/lib/python: Again fix recognizing versions

In commit 55129e390c I changed this code to recognize a few patterns,
but it turns out the code was not fully functioning.

Also move determining the treeish to the same place with the version
regex.

See the numbered comments when determining the treeish for valid
patterns:

1. pre version in between stable releases with explicit commit
   e.g. 4.10.2~pre+1.25e0657ed4-1
   -> use commit 25e0657ed4
2. explicit commit while in rc
   e.g. 4.11.0~rc6+1.35fcb982ea-1~exp1
   -> use commit 35fcb982ea
3. release candidate
   e.g. 4.11.0~rc7-1~exp1
   -> use tag 4.11.0-rc7
4. regular release, like 4.10.2
   -> use tag RELEASE-4.10.2

Signed-off-by: Hans van Kranenburg <hans@knorrie.org>
debian/bin/genorig.py
debian/lib/python/debian_xen/debian.py