[packages/rpm-build-tools] - helper script for bumping version of ka5*spec
witekfl
witekfl at pld-linux.org
Mon May 13 11:45:34 CEST 2019
commit a33fddfef6f66d21751720048257132839ea7ead
Author: Witold Filipczyk <witekfl at poczta.onet.pl>
Date: Mon May 13 11:45:06 2019 +0200
- helper script for bumping version of ka5*spec
ka5up.py | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
---
diff --git a/ka5up.py b/ka5up.py
new file mode 100755
index 0000000..892f690
--- /dev/null
+++ b/ka5up.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+
+"""
+Helper script to update version of ka5*.spec.
+Note that this script only set version, and set release to 1.
+To update md5sum, you can call builder script.
+"""
+
+import os
+import re
+import sys
+
+APP = '%define\t\tkdeappsver\t'
+
+if __name__ == "__main__":
+ if len(sys.argv) != 3:
+ print('Usage: %s specfilename version' % sys.argv[0])
+ print('For example: %s ~/rpm/packages/ka5-konsole/ka5-konsole.spec 19.04.1' % sys.argv[0])
+ sys.exit(1)
+
+ spec = sys.argv[1]
+ version = sys.argv[2]
+
+ tmpspec = spec + '.tmp'
+ newspec = open(tmpspec, 'w')
+
+ with open(spec, 'r') as f:
+ for line in f:
+ if line.startswith(APP):
+ newspec.write("%s%s\n" % (APP, version))
+ elif line.startswith("Version:"):
+ newspec.write("Version:\t%s\n" % version)
+ elif line.startswith("Release:"):
+ newspec.write("Release:\t1\n")
+ else:
+ newspec.write(line)
+ newspec.close()
+ os.rename(tmpspec, spec)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/a33fddfef6f66d21751720048257132839ea7ead
More information about the pld-cvs-commit
mailing list