summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()