summaryrefslogtreecommitdiffstats
path: root/bin/update/signing.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /bin/update/signing.py
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/update/signing.py')
-rw-r--r--bin/update/signing.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/update/signing.py b/bin/update/signing.py
new file mode 100644
index 0000000000..e8546dc83b
--- /dev/null
+++ b/bin/update/signing.py
@@ -0,0 +1,15 @@
+from tools import make_complete_mar_name
+
+import os
+import subprocess
+import path
+
+
+def sign_mar_file(target_dir, certificate_path, certificate_name, mar_file, filename_prefix):
+ signed_mar_file = make_complete_mar_name(target_dir, filename_prefix + '_signed')
+ mar_executable = os.environ.get('MAR', 'mar')
+ subprocess.check_call([mar_executable, '-C', path.convert_to_native(target_dir), '-d',
+ path.convert_to_native(certificate_path), '-n', certificate_name, '-s',
+ path.convert_to_native(mar_file), path.convert_to_native(signed_mar_file)])
+
+ os.rename(signed_mar_file, mar_file)