loleaflet/Makefile.am | 5 +---- loleaflet/util/po2json.py | 8 ++++++++ 2 files changed, 9 insertions(+), 4 deletions(-)
New commits: commit 44fe0027d30d825a43fb110fe5f7323b7a8c040d Author: Andras Timar <[email protected]> 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 <[email protected]> Tested-by: Michael Meeks <[email protected]> (cherry picked from commit 0bfd359a7c366e0eef4b54802f0c9b457a70daed) Reviewed-on: https://gerrit.libreoffice.org/48965 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> 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)); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
