summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-11 11:17:09 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-11 13:54:28 +0000
commit3d494da55b2c55a4027ecb2aece45dee0f5bbb9a (patch)
tree4e5c0474e1c0bc8a4b4494fb80b0ce2cbe2a7a6e /bin
parenta269a8170bf547ba5a76ac509bdd45e8d43fee01 (diff)
downloadjenkins.debian.net-3d494da55b2c55a4027ecb2aece45dee0f5bbb9a.tar.xz
reproducible: common: add a strip_epoch() function
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_common.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 25ae07b5..11b02f8d 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -226,6 +226,21 @@ def join_status_icon(status, package=None, version=None):
') not recognized')
return (status, '')
+def strip_epoch(version):
+ """
+ Stip the epoch out of the version string. Some file (e.g. buildlogs, debs)
+ do not have epoch in their filenames.
+ This recognize a epoch if there is a colon in the second or third character
+ of the version.
+ """
+ try:
+ if version[1] == ':' or version[2] == ':':
+ return version.split(':', 1)[1]
+ else:
+ return version
+ except IndexError:
+ return version
+
# do the db querying
conn = init_conn()