]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Fix update-man-rules when the build dir is not a subdir of the project dir 18365/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 24 Jan 2021 14:13:58 +0000 (14:13 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 24 Jan 2021 17:33:49 +0000 (17:33 +0000)
Until now, update-man-rules assumed that the build directory was
a subdirectory of the project directory. When using mkosi, this is
not the case. We use find instead of git ls-files because git ls-files
does not seem to support outputting absolute paths.

Also, this makes update-man-rules a bit more user-friendly as new manpages
don't have to be added to the git staging area before they are processed by
update-man-rules.py.

man/meson.build
mkosi.build

index f555d629dfa5df11d0ba430fe1014eedf0db0184..88e06b384a0ed0f31b4d002a4257cfcd9fe1cc64 100644 (file)
@@ -217,16 +217,14 @@ endif
 
 ############################################################
 
-if git.found()
-        custom_target(
-                'update-man-rules',
-                output : 'update-man-rules',
-                command : ['sh', '-c',
-                           'cd @0@ && '.format(meson.build_root()) +
-                           'python3 @0@/tools/update-man-rules.py $(git ls-files ":/man/*.xml") >t && '.format(project_source_root) +
-                           'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
-                depend_files : custom_entities_ent)
-endif
+custom_target(
+        'update-man-rules',
+        output : 'update-man-rules',
+        command : ['sh', '-c',
+                        'cd @0@ && '.format(meson.build_root()) +
+                        'python3 @0@/tools/update-man-rules.py $(find @0@ -wholename "*/man/*.xml") >t && '.format(project_source_root) +
+                        'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
+        depend_files : custom_entities_ent)
 
 ############################################################
 
index f28c2892c3d327a4070c2eae0595ef31d36ce0a3..a74fc196be5b3630536b8cf7b01f38c087ac5c95 100755 (executable)
@@ -97,7 +97,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
 fi
 
 cd "$BUILDDIR"
-ninja $@
+ninja "$@"
 if [ "$WITH_TESTS" = 1 ] ; then
         for id in 1 2 3; do
                 getent group $id > /dev/null || groupadd -g $id testgroup$id