]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: support (the removal of) lines with ##
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 13 Apr 2017 00:05:33 +0000 (20:05 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Apr 2017 01:47:28 +0000 (21:47 -0400)
units/meson.build

index b051c5d3cc8e2526f48170b81b1c0fd8c4320ee0..62f1e33dbf3ec179ddf6a0a543136e3b6907d91f 100644 (file)
@@ -225,19 +225,23 @@ foreach tuple : in_units
   install = ((conds.get(0, '') == '' or conf.get(conds[0], 0) == 1) and
              (conds.get(1, '') == '' or conf.get(conds[1], 0) == 1))
 
-  gen = configure_file(
-      input : file + '.in',
-      output : file,
-      configuration : substs)
-  if install
-    install_data(gen,
-                 install_dir : systemunitdir)
+  gen1 = configure_file(
+    input : file + '.in',
+    output : file + '.tmp',
+    configuration : substs)
+  gen2 = custom_target(
+    file,
+    input : gen1,
+    output : file,
+    command : [sed, '/^## /d', '@INPUT@'],
+    capture : true,
+    install : install,
+    install_dir : systemunitdir)
 
-    if tuple.length() > 2
-      foreach target : tuple[2].split()
-        meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file)
-      endforeach
-    endif
+  if install and tuple.length() > 2
+    foreach target : tuple[2].split()
+      meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file)
+    endforeach
   endif
 endforeach