PICARD-1065: Fix patch_version

This commit is contained in:
Sambhav Kothari
2017-04-11 01:00:04 +05:30
parent 532f42cd44
commit 3db758f4e0

View File

@@ -585,9 +585,9 @@ class picard_patch_version(Command):
def patch_version(self, filename):
regex = re.compile(r'^PICARD_BUILD_VERSION_STR\s*=.*$', re.MULTILINE)
with open(filename, 'r+b') as f:
source = f.read()
source = (f.read()).decode()
build = self.platform + '_' + datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')
patched_source = regex.sub('PICARD_BUILD_VERSION_STR = "%s"' % build, source)
patched_source = regex.sub('PICARD_BUILD_VERSION_STR = "%s"' % build, source).encode()
f.seek(0)
f.write(patched_source)
f.truncate()