diff options
-rw-r--r-- | interpreter.py | 8 | ||||
-rw-r--r-- | ninjabackend.py | 2 | ||||
-rw-r--r-- | test cases/common/10 man install/installed_files.txt | 1 | ||||
-rw-r--r-- | test cases/common/10 man install/meson.build | 3 | ||||
-rw-r--r-- | test cases/common/10 man install/vanishing/meson.build | 1 | ||||
-rw-r--r-- | test cases/common/10 man install/vanishing/vanishing.1 | 1 |
6 files changed, 12 insertions, 4 deletions
diff --git a/interpreter.py b/interpreter.py index e49ff92..1ca1713 100644 --- a/interpreter.py +++ b/interpreter.py @@ -324,8 +324,9 @@ class Data(InterpreterObject): class Man(InterpreterObject): - def __init__(self, sources, kwargs): + def __init__(self, source_subdir, sources, kwargs): InterpreterObject.__init__(self) + self.source_subdir = source_subdir self.sources = sources self.validate_sources() if len(kwargs) > 1: @@ -346,6 +347,9 @@ class Man(InterpreterObject): def get_sources(self): return self.sources + def get_source_subdir(self): + return self.source_subdir + class GeneratedObjectsHolder(InterpreterObject): def __init__(self, held_object): super().__init__() @@ -1162,7 +1166,7 @@ class Interpreter(): for a in args: if not isinstance(a, str): raise InvalidArguments('Argument %s is not a string.' % str(a)) - m = Man(args, kwargs) + m = Man(self.subdir, args, kwargs) self.build.man.append(m) return m diff --git a/ninjabackend.py b/ninjabackend.py index 35734c3..178e371 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -448,7 +448,7 @@ class NinjaBackend(backends.Backend): subdir = m.get_custom_install_dir() if subdir is None: subdir = os.path.join(manroot, 'man' + num) - srcabs = os.path.join(self.environment.get_source_dir(), f) + srcabs = os.path.join(self.environment.get_source_dir(), m.get_source_subdir(), f) dstabs = os.path.join(subdir, f + '.gz') i = [srcabs, dstabs] d.man.append(i) diff --git a/test cases/common/10 man install/installed_files.txt b/test cases/common/10 man install/installed_files.txt index 56c8a1a..6a86b92 100644 --- a/test cases/common/10 man install/installed_files.txt +++ b/test cases/common/10 man install/installed_files.txt @@ -1,2 +1,3 @@ share/man/man1/foo.1.gz share/man/man2/bar.2.gz +share/man/man1/vanishing.1.gz diff --git a/test cases/common/10 man install/meson.build b/test cases/common/10 man install/meson.build index bf22c8d..1c93036 100644 --- a/test cases/common/10 man install/meson.build +++ b/test cases/common/10 man install/meson.build @@ -1,3 +1,4 @@ project('man install', 'c') m1 = install_man('foo.1') -m2 = install_man('bar.2')
\ No newline at end of file +m2 = install_man('bar.2') +subdir('vanishing') diff --git a/test cases/common/10 man install/vanishing/meson.build b/test cases/common/10 man install/vanishing/meson.build new file mode 100644 index 0000000..1015450 --- /dev/null +++ b/test cases/common/10 man install/vanishing/meson.build @@ -0,0 +1 @@ +install_man('vanishing.1') diff --git a/test cases/common/10 man install/vanishing/vanishing.1 b/test cases/common/10 man install/vanishing/vanishing.1 new file mode 100644 index 0000000..532608e --- /dev/null +++ b/test cases/common/10 man install/vanishing/vanishing.1 @@ -0,0 +1 @@ +This is a man page of the vanishing subdirectory. |