[Libreoffice-commits] online.git: Branch 'libreoffice-5-4' - loleaflet/Makefile.am loleaflet/util
Andras Timar
andras.timar at collabora.com
Wed Jan 31 16:50:42 UTC 2018
loleaflet/Makefile.am | 5 +----
loleaflet/util/po2json.py | 8 ++++++++
2 files changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 44fe0027d30d825a43fb110fe5f7323b7a8c040d
Author: Andras Timar <andras.timar at collabora.com>
Date: Mon Jul 10 15:00:40 2017 +0200
loleaflet: create destination file's directory with po2json.py
... because the Makefile did not work on SLED11SP4 (?!)
Change-Id: I4e7468149f1c5461aeeb05d3a68e62cda1e329e5
Reviewed-on: https://gerrit.libreoffice.org/39778
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit 0bfd359a7c366e0eef4b54802f0c9b457a70daed)
Reviewed-on: https://gerrit.libreoffice.org/48965
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 248a1888..aa0492f0 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -28,10 +28,7 @@ node_modules: npm-shrinkwrap.json
dist/l10n/%.json: po/%.po
@util/po2json.py $< -o $@
-dist/l10n/styles:
- @mkdir -p $@
-
-dist/l10n/styles/%.json: po/styles/%.po dist/l10n/styles
+dist/l10n/styles/%.json: po/styles/%.po
@util/po2json.py $< -o $@
install-data-hook:
diff --git a/loleaflet/util/po2json.py b/loleaflet/util/po2json.py
index 3769b7be..cfcb45e2 100755
--- a/loleaflet/util/po2json.py
+++ b/loleaflet/util/po2json.py
@@ -10,6 +10,7 @@ import polib
import re
import string
import sys
+import errno
parser = optparse.OptionParser(usage="usage: %prog [options] pofile...")
parser.add_option("--quiet", action="store_false", default=True, dest="verbose", help="don't print status messages to stdout")
@@ -45,6 +46,13 @@ for srcfile in args:
xlate_map[entry.msgid] = entry.msgstr;
+ if not os.path.exists(os.path.dirname(destfile)):
+ try:
+ os.makedirs(os.path.dirname(destfile))
+ except OSError as exc: # Guard against race condition
+ if exc.errno != errno.EEXIST:
+ raise
+
dest = open(destfile, "w")
dest.write(json.dumps(xlate_map, sort_keys = True));
More information about the Libreoffice-commits
mailing list