[gvfs] build: Use generators placeholders



commit dc34f1be6a3c1fa6d5615ad5d647003e7ce3196f
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Dec 17 21:48:02 2018 +0100

    build: Use generators placeholders
    
    Functions derived from generators as `configure_file`,
    `custom_target` and `i18n.merge_file` can use placeholders like
    `@BASENAME@` that removes the extension from the input filename
    string.
    
    The output string has been replaced by this placeholder that
    allows in some cases the use of less variables.

 daemon/meson.build   | 12 +++++-------
 metadata/meson.build |  2 +-
 monitor/meson.build  |  2 +-
 test/meson.build     |  8 +++-----
 4 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/daemon/meson.build b/daemon/meson.build
index a219fc13..e803a743 100644
--- a/daemon/meson.build
+++ b/daemon/meson.build
@@ -10,7 +10,7 @@ if install_systemd_systemduserunitdir
 
   configure_file(
     input: service + '.in',
-    output: service,
+    output: '@BASENAME@',
     configuration: service_conf,
     install: true,
     install_dir: systemd_systemduserunitdir,
@@ -386,14 +386,14 @@ if enable_admin
 
   policy_in = configure_file(
     input: policy + '.in.in',
-    output: policy + '.in',
+    output: '@BASENAME@',
     configuration: service_conf,
   )
 
   i18n.merge_file(
     policy,
     input: policy_in,
-    output: policy,
+    output: '@BASENAME@',
     po_dir: po_dir,
     install: true,
     install_dir: gvfs_datadir / 'polkit-1/actions',
@@ -599,11 +599,9 @@ foreach program: programs
 endforeach
 
 foreach mount: mounts
-  name = mount + '.mount'
-
   configure_file(
-    input: name + '.in',
-    output: name,
+    input: mount + '.mount.in',
+    output: '@BASENAME@',
     configuration: service_conf,
     install: true,
     install_dir: gvfs_mountdir,
diff --git a/metadata/meson.build b/metadata/meson.build
index 20ef5e03..bbfd09fd 100644
--- a/metadata/meson.build
+++ b/metadata/meson.build
@@ -7,7 +7,7 @@ if install_systemd_systemduserunitdir
 
   configure_file(
     input: service + '.in',
-    output: service,
+    output: '@BASENAME@',
     configuration: service_conf,
     install: true,
     install_dir: systemd_systemduserunitdir,
diff --git a/monitor/meson.build b/monitor/meson.build
index eaf4ac0b..50364210 100644
--- a/monitor/meson.build
+++ b/monitor/meson.build
@@ -36,7 +36,7 @@ foreach monitor: monitors
 
     configure_file(
       input: monitor_name / service + '.in',
-      output: service,
+      output: '@BASENAME@',
       configuration: service_conf,
       install: true,
       install_dir: systemd_systemduserunitdir,
diff --git a/test/meson.build b/test/meson.build
index d91a65e3..bc53a4f4 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -5,11 +5,9 @@ if enable_installed_tests
   tests_conf = configuration_data()
   tests_conf.set('testdir', installed_tests_execdir)
 
-  session = 'session.conf'
-
   configure_file(
-    input: session + '.in',
-    output: session,
+    input: 'session.conf.in',
+    output: '@BASENAME@',
     configuration: tests_conf,
     install: true,
     install_dir: installed_tests_execdir,
@@ -19,7 +17,7 @@ if enable_installed_tests
 
   configure_file(
     input: all_tests + '.in',
-    output: all_tests + '.test',
+    output: '@BASENAME@.test',
     configuration: tests_conf,
     install: true,
     install_dir: installed_tests_metadir,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]