From 5ebc77f72223d15fae869ffcc26c0b0020198fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 25 Sep 2016 20:06:02 +0100 Subject: i18n: use POTFILES.in as fallback if there's no POTFILES in po dir In autotools POTFILES is generated at configure time from POTFILES.in, but Meson only looks for a po/POTFILES in the source directory, which is awkward when trying to maintain both build systems in parallel. Instead just use POTFILES.in as fallback if it exists but POTFILES does not. Also print an error if neither exists. Fixes #818 --- mesonbuild/scripts/gettext.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mesonbuild/scripts/gettext.py') diff --git a/mesonbuild/scripts/gettext.py b/mesonbuild/scripts/gettext.py index 4677d5f..1f0a391 100644 --- a/mesonbuild/scripts/gettext.py +++ b/mesonbuild/scripts/gettext.py @@ -19,6 +19,12 @@ from mesonbuild.scripts import destdir_join def run_potgen(src_sub, pkgname, args): listfile = os.path.join(src_sub, 'POTFILES') + if not os.path.exists(listfile): + listfile = os.path.join(src_sub, 'POTFILES.in') + if not os.path.exists(listfile): + print('Could not find file POTFILES in %s' % src_sub) + return 1 + ofile = os.path.join(src_sub, pkgname + '.pot') return subprocess.call(['xgettext', '--package-name=' + pkgname, '-p', src_sub, '-f', listfile, '-D', os.environ['MESON_SOURCE_ROOT'], '-k_', '-o', ofile] + args) -- cgit v1.1