From 02f8a658992923ee0bedcabddc119e5e0762604d Mon Sep 17 00:00:00 2001 From: Joerg Steffens Date: Fri, 15 May 2020 10:51:30 +0200 Subject: [PATCH] python-bareos: fix for adapting version number to PEP-440 --- python-bareos/setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python-bareos/setup.py b/python-bareos/setup.py index 0d954c44d41..257772c4091 100644 --- a/python-bareos/setup.py +++ b/python-bareos/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/python import os +import re from setuptools import find_packages, setup @@ -12,8 +13,10 @@ def get_version(): os.path.join(base_dir, "bareos", "VERSION.txt") ) as version_file: # read version - # and adapt it according to https://www.python.org/dev/peps/pep-0440/. - __version__ = version_file.read().strip().replace('~pre','.dev') + # and adapt it according to + # https://www.python.org/dev/peps/pep-0440/. + fullversion = version_file.read().strip() + __version__ = re.compile(r'~pre([0-9]+).*').sub(r'.dev\1', fullversion) except IOError: # Fallback version. # First protocol implemented