[packages/rpm-build-tools] - script for updating kp5-*

witekfl witekfl at pld-linux.org
Sat May 14 19:20:47 CEST 2022


commit 26a8e92fe9016c4060d3b7ccca84a02cadd02488
Author: Witold Filipczyk <witekfl at poczta.onet.pl>
Date:   Sat May 14 19:19:49 2022 +0200

    - script for updating kp5-*

 kp5up.py | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
---
diff --git a/kp5up.py b/kp5up.py
new file mode 100755
index 0000000..6513fd4
--- /dev/null
+++ b/kp5up.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+
+"""
+Helper script to update version of kp5*.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
+
+KP5 = '%define\t\tkdeplasmaver\t'
+
+if __name__ == "__main__":
+    if len(sys.argv) != 3:
+        print('Usage: %s specfilename version' % sys.argv[0])
+        print('For example: %s ~/rpm/packages/kp5-bluedevil/kp5-bluedevil.spec 5.16.4' % 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(KP5):
+                newspec.write("%s%s\n" % (KP5, 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/26a8e92fe9016c4060d3b7ccca84a02cadd02488



More information about the pld-cvs-commit mailing list