aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJason Woodward <woodwardj@jaos.org>2021-02-21 23:46:20 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2021-02-27 14:35:23 +0200
commit50af09de031c8d003cd9e6afb44b774620b45696 (patch)
tree52e16c84d9f9b851a05307e4fa4f053e44bab00c /mesonbuild/backend/backends.py
parent0047f7439c6bafe964438e2c59a3686201ff24c0 (diff)
downloadmeson-50af09de031c8d003cd9e6afb44b774620b45696.zip
meson-50af09de031c8d003cd9e6afb44b774620b45696.tar.gz
meson-50af09de031c8d003cd9e6afb44b774620b45696.tar.bz2
install_man locale support
Rather than having to manually build the locale aware man paths with `install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')` Support doing `install_man('foo.fr.1', locale: 'fr')`
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 8fe9189..9ac02d0 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1399,9 +1399,15 @@ class Backend:
num = f.split('.')[-1]
subdir = m.get_custom_install_dir()
if subdir is None:
- subdir = os.path.join(manroot, 'man' + num)
+ if m.locale:
+ subdir = os.path.join(manroot, m.locale, 'man' + num)
+ else:
+ subdir = os.path.join(manroot, 'man' + num)
+ fname = f.fname
+ if m.locale: # strip locale from file name
+ fname = fname.replace(f'.{m.locale}', '')
srcabs = f.absolute_path(self.environment.get_source_dir(), self.environment.get_build_dir())
- dstabs = os.path.join(subdir, os.path.basename(f.fname))
+ dstabs = os.path.join(subdir, os.path.basename(fname))
i = InstallDataBase(srcabs, dstabs, m.get_custom_install_mode(), m.subproject)
d.man.append(i)