From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- solenv/bin/version.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 solenv/bin/version.py (limited to 'solenv/bin/version.py') diff --git a/solenv/bin/version.py b/solenv/bin/version.py new file mode 100755 index 000000000..3193b3fa3 --- /dev/null +++ b/solenv/bin/version.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +from optparse import OptionParser +import os.path +import re +import sys + +M = { + 'juh': 'javaunohelper', + 'jurt': 'jurt', + 'officebean': 'bean', + 'ridl': 'ridljar', + 'unoil': 'unoil', + 'unoloader': 'ridljar', + 'libreoffice': 'ridljar', +} + +parser = OptionParser() +_, args = parser.parse_args() + +if not len(args): + parser.error('not enough arguments') +elif len(args) > 1: + parser.error('too many arguments') + +DEST = r'\g<1>%s\g<3>' % args[0] + + +def replace_in_file(filename, src_pattern): + try: + f = open(filename, "r") + s = f.read() + f.close() + s = re.sub(src_pattern, DEST, s) + f = open(filename, "w") + f.write(s) + f.close() + except IOError as err: + print('error updating %s: %s' % (filename, err), file=sys.stderr) + +src_pattern = re.compile(r'^(\s*)([-.@\w]+)(\s*)$', + re.MULTILINE) + +for a in ['juh', 'jurt', 'libreoffice', 'officebean', 'ridl', 'unoil', 'unoloader']: + replace_in_file(os.path.join(M[a], 'pom.%s.xml' % a), src_pattern) + +src_pattern = re.compile(r"^(LIBREOFFICE_VERSION = ')([-.@\w]+)(')$", + re.MULTILINE) +replace_in_file('solenv/maven/VERSION', src_pattern) -- cgit v1.2.3