From 264d8dcc161e276d31dcde98a088d15cebbebbef Mon Sep 17 00:00:00 2001 From: Gunnar Hjalmarsson Date: Thu, 15 Feb 2018 21:21:58 +0100 Subject: [PATCH 1/6] Gettextize policy files * Don't merge translations into the files * Add gettext-domain="systemd" to description and message Closes #8162, replaces #8118. --- src/core/meson.build | 15 +- .../org.freedesktop.systemd1.policy.in.in | 20 +-- src/hostname/meson.build | 10 +- .../org.freedesktop.hostname1.policy.in | 12 +- src/import/meson.build | 10 +- src/import/org.freedesktop.import1.policy.in | 12 +- src/locale/meson.build | 10 +- src/locale/org.freedesktop.locale1.policy.in | 8 +- src/login/meson.build | 10 +- src/login/org.freedesktop.login1.policy.in | 128 +++++++++--------- src/machine/meson.build | 10 +- .../org.freedesktop.machine1.policy.in | 32 ++--- src/resolve/meson.build | 10 +- .../org.freedesktop.resolve1.policy.in | 8 +- src/timedate/meson.build | 10 +- .../org.freedesktop.timedate1.policy.in | 16 +-- 16 files changed, 150 insertions(+), 171 deletions(-) diff --git a/src/core/meson.build b/src/core/meson.build index bc034082a5..c58893b7cb 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -211,19 +211,12 @@ install_data('org.freedesktop.systemd1.conf', install_data('org.freedesktop.systemd1.service', install_dir : dbussystemservicedir) -policy_in = configure_file( +policy = configure_file( input : 'org.freedesktop.systemd1.policy.in.in', - output : 'org.freedesktop.systemd1.policy.in', - configuration : substs) - -i18n.merge_file( - 'org.freedesktop.systemd1.policy', - input : policy_in, output : 'org.freedesktop.systemd1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) +install_data(policy, + install_dir : polkitpolicydir) install_data('system.conf', 'user.conf', diff --git a/src/core/org.freedesktop.systemd1.policy.in.in b/src/core/org.freedesktop.systemd1.policy.in.in index 2c6ed749fd..648221b85c 100644 --- a/src/core/org.freedesktop.systemd1.policy.in.in +++ b/src/core/org.freedesktop.systemd1.policy.in.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Send passphrase back to system - Authentication is required to send the entered passphrase back to the system. + Send passphrase back to system + Authentication is required to send the entered passphrase back to the system. no no @@ -30,8 +30,8 @@ - Manage system services or other units - Authentication is required to manage system services or other units. + Manage system services or other units + Authentication is required to manage system services or other units. auth_admin auth_admin @@ -40,8 +40,8 @@ - Manage system service or unit files - Authentication is required to manage system service or unit files. + Manage system service or unit files + Authentication is required to manage system service or unit files. auth_admin auth_admin @@ -50,8 +50,8 @@ - Set or unset system and service manager environment variables - Authentication is required to set or unset system and service manager environment variables. + Set or unset system and service manager environment variables + Authentication is required to set or unset system and service manager environment variables. auth_admin auth_admin @@ -60,8 +60,8 @@ - Reload the systemd state - Authentication is required to reload the systemd state. + Reload the systemd state + Authentication is required to reload the systemd state. auth_admin auth_admin diff --git a/src/hostname/meson.build b/src/hostname/meson.build index 75cc94874b..c35c6688ba 100644 --- a/src/hostname/meson.build +++ b/src/hostname/meson.build @@ -21,12 +21,10 @@ if conf.get('ENABLE_HOSTNAMED') == 1 install_data('org.freedesktop.hostname1.service', install_dir : dbussystemservicedir) - i18n.merge_file( - 'org.freedesktop.hostname1.policy', + policy = configure_file( input : 'org.freedesktop.hostname1.policy.in', output : 'org.freedesktop.hostname1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) + install_data(policy, + install_dir : polkitpolicydir) endif diff --git a/src/hostname/org.freedesktop.hostname1.policy.in b/src/hostname/org.freedesktop.hostname1.policy.in index b10ca31ac5..4ac82c659c 100644 --- a/src/hostname/org.freedesktop.hostname1.policy.in +++ b/src/hostname/org.freedesktop.hostname1.policy.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Set host name - Authentication is required to set the local host name. + Set host name + Authentication is required to set the local host name. auth_admin_keep auth_admin_keep @@ -29,8 +29,8 @@ - Set static host name - Authentication is required to set the statically configured local host name, as well as the pretty host name. + Set static host name + Authentication is required to set the statically configured local host name, as well as the pretty host name. auth_admin_keep auth_admin_keep @@ -40,8 +40,8 @@ - Set machine information - Authentication is required to set local machine information. + Set machine information + Authentication is required to set local machine information. auth_admin_keep auth_admin_keep diff --git a/src/import/meson.build b/src/import/meson.build index 2dcc0bcc00..e5088b3434 100644 --- a/src/import/meson.build +++ b/src/import/meson.build @@ -71,14 +71,12 @@ if conf.get('ENABLE_IMPORTD') == 1 install_data('org.freedesktop.import1.service', install_dir : dbussystemservicedir) - i18n.merge_file( - 'org.freedesktop.import1.policy', + policy = configure_file( input : 'org.freedesktop.import1.policy.in', output : 'org.freedesktop.import1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) + install_data(policy, + install_dir : polkitpolicydir) install_data('import-pubring.gpg', install_dir : rootlibexecdir) diff --git a/src/import/org.freedesktop.import1.policy.in b/src/import/org.freedesktop.import1.policy.in index d96ca2d060..beea5fea67 100644 --- a/src/import/org.freedesktop.import1.policy.in +++ b/src/import/org.freedesktop.import1.policy.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Import a VM or container image - Authentication is required to import a VM or container image + Import a VM or container image + Authentication is required to import a VM or container image auth_admin auth_admin @@ -29,8 +29,8 @@ - Export a VM or container image - Authentication is required to export a VM or container image + Export a VM or container image + Authentication is required to export a VM or container image auth_admin auth_admin @@ -39,8 +39,8 @@ - Download a VM or container image - Authentication is required to download a VM or container image + Download a VM or container image + Authentication is required to download a VM or container image auth_admin auth_admin diff --git a/src/locale/meson.build b/src/locale/meson.build index dca2c51d2f..30882cc027 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -29,14 +29,12 @@ if conf.get('ENABLE_LOCALED') == 1 install_data('org.freedesktop.locale1.service', install_dir : dbussystemservicedir) - i18n.merge_file( - 'org.freedesktop.locale1.policy', + policy = configure_file( input : 'org.freedesktop.locale1.policy.in', output : 'org.freedesktop.locale1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) + install_data(policy, + install_dir : polkitpolicydir) endif # If you know a way that allows the same variables to be used diff --git a/src/locale/org.freedesktop.locale1.policy.in b/src/locale/org.freedesktop.locale1.policy.in index 4c1c34da09..f9241749e6 100644 --- a/src/locale/org.freedesktop.locale1.policy.in +++ b/src/locale/org.freedesktop.locale1.policy.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Set system locale - Authentication is required to set the system locale. + Set system locale + Authentication is required to set the system locale. auth_admin_keep auth_admin_keep @@ -30,8 +30,8 @@ - Set system keyboard settings - Authentication is required to set the system keyboard settings. + Set system keyboard settings + Authentication is required to set the system keyboard settings. auth_admin_keep auth_admin_keep diff --git a/src/login/meson.build b/src/login/meson.build index e8e4f7bd7d..599c44ea97 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -88,14 +88,12 @@ if conf.get('ENABLE_LOGIND') == 1 install_data('org.freedesktop.login1.service', install_dir : dbussystemservicedir) - i18n.merge_file( - 'org.freedesktop.login1.policy', + policy = configure_file( input : 'org.freedesktop.login1.policy.in', output : 'org.freedesktop.login1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) + install_data(policy, + install_dir : polkitpolicydir) install_data('70-power-switch.rules', install_dir : udevrulesdir) diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy.in index 47162022d2..f1d1f956d3 100644 --- a/src/login/org.freedesktop.login1.policy.in +++ b/src/login/org.freedesktop.login1.policy.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Allow applications to inhibit system shutdown - Authentication is required for an application to inhibit system shutdown. + Allow applications to inhibit system shutdown + Authentication is required for an application to inhibit system shutdown. no yes @@ -30,8 +30,8 @@ - Allow applications to delay system shutdown - Authentication is required for an application to delay system shutdown. + Allow applications to delay system shutdown + Authentication is required for an application to delay system shutdown. yes yes @@ -41,8 +41,8 @@ - Allow applications to inhibit system sleep - Authentication is required for an application to inhibit system sleep. + Allow applications to inhibit system sleep + Authentication is required for an application to inhibit system sleep. no yes @@ -52,8 +52,8 @@ - Allow applications to delay system sleep - Authentication is required for an application to delay system sleep. + Allow applications to delay system sleep + Authentication is required for an application to delay system sleep. yes yes @@ -62,8 +62,8 @@ - Allow applications to inhibit automatic system suspend - Authentication is required for an application to inhibit automatic system suspend. + Allow applications to inhibit automatic system suspend + Authentication is required for an application to inhibit automatic system suspend. yes yes @@ -72,8 +72,8 @@ - Allow applications to inhibit system handling of the power key - Authentication is required for an application to inhibit system handling of the power key. + Allow applications to inhibit system handling of the power key + Authentication is required for an application to inhibit system handling of the power key. no yes @@ -83,8 +83,8 @@ - Allow applications to inhibit system handling of the suspend key - Authentication is required for an application to inhibit system handling of the suspend key. + Allow applications to inhibit system handling of the suspend key + Authentication is required for an application to inhibit system handling of the suspend key. no yes @@ -94,8 +94,8 @@ - Allow applications to inhibit system handling of the hibernate key - Authentication is required for an application to inhibit system handling of the hibernate key. + Allow applications to inhibit system handling of the hibernate key + Authentication is required for an application to inhibit system handling of the hibernate key. no yes @@ -104,8 +104,8 @@ - Allow applications to inhibit system handling of the lid switch - Authentication is required for an application to inhibit system handling of the lid switch. + Allow applications to inhibit system handling of the lid switch + Authentication is required for an application to inhibit system handling of the lid switch. no yes @@ -114,8 +114,8 @@ - Allow non-logged-in user to run programs - Explicit request is required to run programs as a non-logged-in user. + Allow non-logged-in user to run programs + Explicit request is required to run programs as a non-logged-in user. yes yes @@ -124,8 +124,8 @@ - Allow non-logged-in users to run programs - Authentication is required to run programs as a non-logged-in user. + Allow non-logged-in users to run programs + Authentication is required to run programs as a non-logged-in user. auth_admin_keep auth_admin_keep @@ -134,8 +134,8 @@ - Allow attaching devices to seats - Authentication is required for attaching a device to a seat. + Allow attaching devices to seats + Authentication is required for attaching a device to a seat. auth_admin_keep auth_admin_keep @@ -145,8 +145,8 @@ - Flush device to seat attachments - Authentication is required for resetting how devices are attached to seats. + Flush device to seat attachments + Authentication is required for resetting how devices are attached to seats. auth_admin_keep auth_admin_keep @@ -155,8 +155,8 @@ - Power off the system - Authentication is required for powering off the system. + Power off the system + Authentication is required for powering off the system. auth_admin_keep auth_admin_keep @@ -166,8 +166,8 @@ - Power off the system while other users are logged in - Authentication is required for powering off the system while other users are logged in. + Power off the system while other users are logged in + Authentication is required for powering off the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -177,8 +177,8 @@ - Power off the system while an application asked to inhibit it - Authentication is required for powering off the system while an application asked to inhibit it. + Power off the system while an application asked to inhibit it + Authentication is required for powering off the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -188,8 +188,8 @@ - Reboot the system - Authentication is required for rebooting the system. + Reboot the system + Authentication is required for rebooting the system. auth_admin_keep auth_admin_keep @@ -199,8 +199,8 @@ - Reboot the system while other users are logged in - Authentication is required for rebooting the system while other users are logged in. + Reboot the system while other users are logged in + Authentication is required for rebooting the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -210,8 +210,8 @@ - Reboot the system while an application asked to inhibit it - Authentication is required for rebooting the system while an application asked to inhibit it. + Reboot the system while an application asked to inhibit it + Authentication is required for rebooting the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -221,8 +221,8 @@ - Halt the system - Authentication is required for halting the system. + Halt the system + Authentication is required for halting the system. auth_admin_keep auth_admin_keep @@ -232,8 +232,8 @@ - Halt the system while other users are logged in - Authentication is required for halting the system while other users are logged in. + Halt the system while other users are logged in + Authentication is required for halting the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -243,8 +243,8 @@ - Halt the system while an application asked to inhibit it - Authentication is required for halting the system while an application asked to inhibit it. + Halt the system while an application asked to inhibit it + Authentication is required for halting the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -254,8 +254,8 @@ - Suspend the system - Authentication is required for suspending the system. + Suspend the system + Authentication is required for suspending the system. auth_admin_keep auth_admin_keep @@ -264,8 +264,8 @@ - Suspend the system while other users are logged in - Authentication is required for suspending the system while other users are logged in. + Suspend the system while other users are logged in + Authentication is required for suspending the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -275,8 +275,8 @@ - Suspend the system while an application asked to inhibit it - Authentication is required for suspending the system while an application asked to inhibit it. + Suspend the system while an application asked to inhibit it + Authentication is required for suspending the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -286,8 +286,8 @@ - Hibernate the system - Authentication is required for hibernating the system. + Hibernate the system + Authentication is required for hibernating the system. auth_admin_keep auth_admin_keep @@ -296,8 +296,8 @@ - Hibernate the system while other users are logged in - Authentication is required for hibernating the system while other users are logged in. + Hibernate the system while other users are logged in + Authentication is required for hibernating the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -307,8 +307,8 @@ - Hibernate the system while an application asked to inhibit it - Authentication is required for hibernating the system while an application asked to inhibit it. + Hibernate the system while an application asked to inhibit it + Authentication is required for hibernating the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -318,8 +318,8 @@ - Manage active sessions, users and seats - Authentication is required for managing active sessions, users and seats. + Manage active sessions, users and seats + Authentication is required for managing active sessions, users and seats. auth_admin_keep auth_admin_keep @@ -328,8 +328,8 @@ - Lock or unlock active sessions - Authentication is required to lock or unlock active sessions. + Lock or unlock active sessions + Authentication is required to lock or unlock active sessions. auth_admin_keep auth_admin_keep @@ -338,8 +338,8 @@ - Allow indication to the firmware to boot to setup interface - Authentication is required to indicate to the firmware to boot to setup interface. + Allow indication to the firmware to boot to setup interface + Authentication is required to indicate to the firmware to boot to setup interface. auth_admin_keep auth_admin_keep @@ -348,8 +348,8 @@ - Set a wall message - Authentication is required to set a wall message + Set a wall message + Authentication is required to set a wall message auth_admin_keep auth_admin_keep diff --git a/src/machine/meson.build b/src/machine/meson.build index 7ea5d9de80..0f2944c8fe 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -44,14 +44,12 @@ if conf.get('ENABLE_MACHINED') == 1 install_data('org.freedesktop.machine1.service', install_dir : dbussystemservicedir) - i18n.merge_file( - 'org.freedesktop.machine1.policy', + policy = configure_file( input : 'org.freedesktop.machine1.policy.in', output : 'org.freedesktop.machine1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) + install_data(policy, + install_dir : polkitpolicydir) endif tests += [ diff --git a/src/machine/org.freedesktop.machine1.policy.in b/src/machine/org.freedesktop.machine1.policy.in index eeeeb4c0f8..039c3d4513 100644 --- a/src/machine/org.freedesktop.machine1.policy.in +++ b/src/machine/org.freedesktop.machine1.policy.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Log into a local container - Authentication is required to log into a local container. + Log into a local container + Authentication is required to log into a local container. auth_admin auth_admin @@ -29,8 +29,8 @@ - Log into the local host - Authentication is required to log into the local host. + Log into the local host + Authentication is required to log into the local host. auth_admin auth_admin @@ -39,8 +39,8 @@ - Acquire a shell in a local container - Authentication is required to acquire a shell in a local container. + Acquire a shell in a local container + Authentication is required to acquire a shell in a local container. auth_admin auth_admin @@ -50,8 +50,8 @@ - Acquire a shell on the local host - Authentication is required to acquire a shell on the local host. + Acquire a shell on the local host + Authentication is required to acquire a shell on the local host. auth_admin auth_admin @@ -61,8 +61,8 @@ - Acquire a pseudo TTY in a local container - Authentication is required to acquire a pseudo TTY in a local container. + Acquire a pseudo TTY in a local container + Authentication is required to acquire a pseudo TTY in a local container. auth_admin auth_admin @@ -71,8 +71,8 @@ - Acquire a pseudo TTY on the local host - Authentication is required to acquire a pseudo TTY on the local host. + Acquire a pseudo TTY on the local host + Authentication is required to acquire a pseudo TTY on the local host. auth_admin auth_admin @@ -81,8 +81,8 @@ - Manage local virtual machines and containers - Authentication is required to manage local virtual machines and containers. + Manage local virtual machines and containers + Authentication is required to manage local virtual machines and containers. auth_admin auth_admin @@ -92,8 +92,8 @@ - Manage local virtual machine and container images - Authentication is required to manage local virtual machine and container images. + Manage local virtual machine and container images + Authentication is required to manage local virtual machine and container images. auth_admin auth_admin diff --git a/src/resolve/meson.build b/src/resolve/meson.build index 15752d24ff..7e7876d19f 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -165,14 +165,12 @@ if conf.get('ENABLE_RESOLVE') == 1 install_data('resolv.conf', install_dir : rootlibexecdir) - i18n.merge_file( - 'org.freedesktop.resolve1.policy', + policy = configure_file( input : 'org.freedesktop.resolve1.policy.in', output : 'org.freedesktop.resolve1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) + install_data(policy, + install_dir : polkitpolicydir) endif tests += [ diff --git a/src/resolve/org.freedesktop.resolve1.policy.in b/src/resolve/org.freedesktop.resolve1.policy.in index da948eb0b7..b65ba3e56a 100644 --- a/src/resolve/org.freedesktop.resolve1.policy.in +++ b/src/resolve/org.freedesktop.resolve1.policy.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Register a DNS-SD service - Authentication is required to register a DNS-SD service + Register a DNS-SD service + Authentication is required to register a DNS-SD service auth_admin auth_admin @@ -30,8 +30,8 @@ - Unregister a DNS-SD service - Authentication is required to unregister a DNS-SD service + Unregister a DNS-SD service + Authentication is required to unregister a DNS-SD service auth_admin auth_admin diff --git a/src/timedate/meson.build b/src/timedate/meson.build index 80e5cd21be..6892596b25 100644 --- a/src/timedate/meson.build +++ b/src/timedate/meson.build @@ -21,12 +21,10 @@ if conf.get('ENABLE_TIMEDATED') == 1 install_data('org.freedesktop.timedate1.service', install_dir : dbussystemservicedir) - i18n.merge_file( - 'org.freedesktop.timedate1.policy', + policy = configure_file( input : 'org.freedesktop.timedate1.policy.in', output : 'org.freedesktop.timedate1.policy', - po_dir : po_dir, - data_dirs : po_dir, - install : install_polkit, - install_dir : polkitpolicydir) + configuration : substs) + install_data(policy, + install_dir : polkitpolicydir) endif diff --git a/src/timedate/org.freedesktop.timedate1.policy.in b/src/timedate/org.freedesktop.timedate1.policy.in index cc2e1652da..d488572ae3 100644 --- a/src/timedate/org.freedesktop.timedate1.policy.in +++ b/src/timedate/org.freedesktop.timedate1.policy.in @@ -19,8 +19,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Set system time - Authentication is required to set the system time. + Set system time + Authentication is required to set the system time. auth_admin_keep auth_admin_keep @@ -30,8 +30,8 @@ - Set system timezone - Authentication is required to set the system timezone. + Set system timezone + Authentication is required to set the system timezone. auth_admin_keep auth_admin_keep @@ -40,8 +40,8 @@ - Set RTC to local timezone or UTC - Authentication is required to control whether + Set RTC to local timezone or UTC + Authentication is required to control whether the RTC stores the local or UTC time. auth_admin_keep @@ -51,8 +51,8 @@ - Turn network time synchronization on or off - Authentication is required to control whether + Turn network time synchronization on or off + Authentication is required to control whether network time synchronization shall be enabled. auth_admin_keep From 70886abbde59a45cfabe0769c0cdb3af1e5f7790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 16 Feb 2018 12:37:42 +0100 Subject: [PATCH 2/6] meson: drop double .in suffix for o.fd.systemd1.policy file This file is now undergoing just one transformation, so drop the unnecessary suffix. --- src/core/meson.build | 2 +- ...systemd1.policy.in.in => org.freedesktop.systemd1.policy.in} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/core/{org.freedesktop.systemd1.policy.in.in => org.freedesktop.systemd1.policy.in} (100%) diff --git a/src/core/meson.build b/src/core/meson.build index c58893b7cb..01706dbf29 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -212,7 +212,7 @@ install_data('org.freedesktop.systemd1.service', install_dir : dbussystemservicedir) policy = configure_file( - input : 'org.freedesktop.systemd1.policy.in.in', + input : 'org.freedesktop.systemd1.policy.in', output : 'org.freedesktop.systemd1.policy', configuration : substs) install_data(policy, diff --git a/src/core/org.freedesktop.systemd1.policy.in.in b/src/core/org.freedesktop.systemd1.policy.in similarity index 100% rename from src/core/org.freedesktop.systemd1.policy.in.in rename to src/core/org.freedesktop.systemd1.policy.in From 9b3cff199dd3827a9f2df9a7f5874d6ef18880f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 16 Feb 2018 12:48:55 +0100 Subject: [PATCH 3/6] meson: drop unnecessary "transformation" of policy files Those files don't contain any @variables@, so the configuration step was just copying them to build/. Let's avoid that, and fix their suffixes while at it. --- src/hostname/meson.build | 7 +------ ...tname1.policy.in => org.freedesktop.hostname1.policy} | 0 src/import/meson.build | 7 +------ ....import1.policy.in => org.freedesktop.import1.policy} | 0 src/locale/meson.build | 7 +------ ....locale1.policy.in => org.freedesktop.locale1.policy} | 0 src/login/meson.build | 7 +------ ...op.login1.policy.in => org.freedesktop.login1.policy} | 0 src/machine/meson.build | 7 +------ ...achine1.policy.in => org.freedesktop.machine1.policy} | 0 src/resolve/meson.build | 9 ++------- ...esolve1.policy.in => org.freedesktop.resolve1.policy} | 0 src/timedate/meson.build | 7 +------ ...edate1.policy.in => org.freedesktop.timedate1.policy} | 0 14 files changed, 8 insertions(+), 43 deletions(-) rename src/hostname/{org.freedesktop.hostname1.policy.in => org.freedesktop.hostname1.policy} (100%) rename src/import/{org.freedesktop.import1.policy.in => org.freedesktop.import1.policy} (100%) rename src/locale/{org.freedesktop.locale1.policy.in => org.freedesktop.locale1.policy} (100%) rename src/login/{org.freedesktop.login1.policy.in => org.freedesktop.login1.policy} (100%) rename src/machine/{org.freedesktop.machine1.policy.in => org.freedesktop.machine1.policy} (100%) rename src/resolve/{org.freedesktop.resolve1.policy.in => org.freedesktop.resolve1.policy} (100%) rename src/timedate/{org.freedesktop.timedate1.policy.in => org.freedesktop.timedate1.policy} (100%) diff --git a/src/hostname/meson.build b/src/hostname/meson.build index c35c6688ba..1ab9271b4c 100644 --- a/src/hostname/meson.build +++ b/src/hostname/meson.build @@ -20,11 +20,6 @@ if conf.get('ENABLE_HOSTNAMED') == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.hostname1.service', install_dir : dbussystemservicedir) - - policy = configure_file( - input : 'org.freedesktop.hostname1.policy.in', - output : 'org.freedesktop.hostname1.policy', - configuration : substs) - install_data(policy, + install_data('org.freedesktop.hostname1.policy', install_dir : polkitpolicydir) endif diff --git a/src/hostname/org.freedesktop.hostname1.policy.in b/src/hostname/org.freedesktop.hostname1.policy similarity index 100% rename from src/hostname/org.freedesktop.hostname1.policy.in rename to src/hostname/org.freedesktop.hostname1.policy diff --git a/src/import/meson.build b/src/import/meson.build index e5088b3434..975afc624d 100644 --- a/src/import/meson.build +++ b/src/import/meson.build @@ -70,12 +70,7 @@ if conf.get('ENABLE_IMPORTD') == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.import1.service', install_dir : dbussystemservicedir) - - policy = configure_file( - input : 'org.freedesktop.import1.policy.in', - output : 'org.freedesktop.import1.policy', - configuration : substs) - install_data(policy, + install_data('org.freedesktop.import1.policy', install_dir : polkitpolicydir) install_data('import-pubring.gpg', diff --git a/src/import/org.freedesktop.import1.policy.in b/src/import/org.freedesktop.import1.policy similarity index 100% rename from src/import/org.freedesktop.import1.policy.in rename to src/import/org.freedesktop.import1.policy diff --git a/src/locale/meson.build b/src/locale/meson.build index 30882cc027..6b85f6bea6 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -28,12 +28,7 @@ if conf.get('ENABLE_LOCALED') == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.locale1.service', install_dir : dbussystemservicedir) - - policy = configure_file( - input : 'org.freedesktop.locale1.policy.in', - output : 'org.freedesktop.locale1.policy', - configuration : substs) - install_data(policy, + install_data('org.freedesktop.locale1.policy', install_dir : polkitpolicydir) endif diff --git a/src/locale/org.freedesktop.locale1.policy.in b/src/locale/org.freedesktop.locale1.policy similarity index 100% rename from src/locale/org.freedesktop.locale1.policy.in rename to src/locale/org.freedesktop.locale1.policy diff --git a/src/login/meson.build b/src/login/meson.build index 599c44ea97..5b75382e5f 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -87,12 +87,7 @@ if conf.get('ENABLE_LOGIND') == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.login1.service', install_dir : dbussystemservicedir) - - policy = configure_file( - input : 'org.freedesktop.login1.policy.in', - output : 'org.freedesktop.login1.policy', - configuration : substs) - install_data(policy, + install_data('org.freedesktop.login1.policy', install_dir : polkitpolicydir) install_data('70-power-switch.rules', install_dir : udevrulesdir) diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy similarity index 100% rename from src/login/org.freedesktop.login1.policy.in rename to src/login/org.freedesktop.login1.policy diff --git a/src/machine/meson.build b/src/machine/meson.build index 0f2944c8fe..b530ca6377 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -43,12 +43,7 @@ if conf.get('ENABLE_MACHINED') == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.machine1.service', install_dir : dbussystemservicedir) - - policy = configure_file( - input : 'org.freedesktop.machine1.policy.in', - output : 'org.freedesktop.machine1.policy', - configuration : substs) - install_data(policy, + install_data('org.freedesktop.machine1.policy', install_dir : polkitpolicydir) endif diff --git a/src/machine/org.freedesktop.machine1.policy.in b/src/machine/org.freedesktop.machine1.policy similarity index 100% rename from src/machine/org.freedesktop.machine1.policy.in rename to src/machine/org.freedesktop.machine1.policy diff --git a/src/resolve/meson.build b/src/resolve/meson.build index 7e7876d19f..16ba83ef88 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -154,6 +154,8 @@ if conf.get('ENABLE_RESOLVE') == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.resolve1.service', install_dir : dbussystemservicedir) + install_data('org.freedesktop.resolve1.policy', + install_dir : polkitpolicydir) resolved_conf = configure_file( input : 'resolved.conf.in', @@ -164,13 +166,6 @@ if conf.get('ENABLE_RESOLVE') == 1 install_data('resolv.conf', install_dir : rootlibexecdir) - - policy = configure_file( - input : 'org.freedesktop.resolve1.policy.in', - output : 'org.freedesktop.resolve1.policy', - configuration : substs) - install_data(policy, - install_dir : polkitpolicydir) endif tests += [ diff --git a/src/resolve/org.freedesktop.resolve1.policy.in b/src/resolve/org.freedesktop.resolve1.policy similarity index 100% rename from src/resolve/org.freedesktop.resolve1.policy.in rename to src/resolve/org.freedesktop.resolve1.policy diff --git a/src/timedate/meson.build b/src/timedate/meson.build index 6892596b25..87482c04e5 100644 --- a/src/timedate/meson.build +++ b/src/timedate/meson.build @@ -20,11 +20,6 @@ if conf.get('ENABLE_TIMEDATED') == 1 install_dir : dbuspolicydir) install_data('org.freedesktop.timedate1.service', install_dir : dbussystemservicedir) - - policy = configure_file( - input : 'org.freedesktop.timedate1.policy.in', - output : 'org.freedesktop.timedate1.policy', - configuration : substs) - install_data(policy, + install_data('org.freedesktop.timedate1.policy', install_dir : polkitpolicydir) endif diff --git a/src/timedate/org.freedesktop.timedate1.policy.in b/src/timedate/org.freedesktop.timedate1.policy similarity index 100% rename from src/timedate/org.freedesktop.timedate1.policy.in rename to src/timedate/org.freedesktop.timedate1.policy From 9e8f3893e349a68312a817da72b3473b81b6869e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 15 Feb 2018 21:38:15 +0100 Subject: [PATCH 4/6] mkosi: remove intltool from deps intltool is unnecessary since c81217920effddc93fb780cf8f9eb699d6fe1319. But we still need gettext, because we use msgformat to generate .mo files. (I tried to make meson depend on it, at least in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1545926, but that didn't fly, and in Debian at least meson also has no dependency on the tools used by its i18n module, so we need to add our own dependency anyway.) Closes #8192. --- .mkosi/mkosi.arch | 2 +- .mkosi/mkosi.debian | 2 +- .mkosi/mkosi.fedora | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mkosi/mkosi.arch b/.mkosi/mkosi.arch index d7f6bc866a..dac80d38f7 100644 --- a/.mkosi/mkosi.arch +++ b/.mkosi/mkosi.arch @@ -41,11 +41,11 @@ BuildPackages= docbook-xsl elfutils gcc + gettext git gnu-efi-libs gnutls gperf - intltool iptables kmod libcap diff --git a/.mkosi/mkosi.debian b/.mkosi/mkosi.debian index a93eb7b539..de47df1847 100644 --- a/.mkosi/mkosi.debian +++ b/.mkosi/mkosi.debian @@ -37,10 +37,10 @@ BuildPackages= docbook-xml docbook-xsl gcc + gettext git gnu-efi gperf - intltool iptables-dev libacl1-dev libaudit-dev diff --git a/.mkosi/mkosi.fedora b/.mkosi/mkosi.fedora index e642c0b064..0aeb7751cb 100644 --- a/.mkosi/mkosi.fedora +++ b/.mkosi/mkosi.fedora @@ -41,12 +41,12 @@ BuildPackages= docbook-style-xsl elfutils-devel gcc + gettext git gnu-efi gnu-efi-devel gnutls-devel gperf - intltool iptables-devel kmod-devel libacl-devel From d4d4688122a228a90d39ac3bddf29d1bb33d9850 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 16 Feb 2018 14:25:32 +0100 Subject: [PATCH 5/6] l10n: Update POTFILES.in and POTFILES.skip We no longer use .in suffixes for .policy files. Follow-up for commit 9b3cff199dd3827a9f2df9a7f5874d6ef18880f2 and 70886abbde59a45cfabe0769c0cdb3af1e5f7790. --- po/POTFILES.in | 16 ++++++++-------- po/POTFILES.skip | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index f610828b21..470829acae 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,9 +1,9 @@ -src/core/org.freedesktop.systemd1.policy.in.in -src/hostname/org.freedesktop.hostname1.policy.in -src/import/org.freedesktop.import1.policy.in -src/locale/org.freedesktop.locale1.policy.in -src/login/org.freedesktop.login1.policy.in -src/machine/org.freedesktop.machine1.policy.in -src/resolve/org.freedesktop.resolve1.policy.in -src/timedate/org.freedesktop.timedate1.policy.in +src/core/org.freedesktop.systemd1.policy.in +src/hostname/org.freedesktop.hostname1.policy +src/import/org.freedesktop.import1.policy +src/locale/org.freedesktop.locale1.policy +src/login/org.freedesktop.login1.policy +src/machine/org.freedesktop.machine1.policy +src/resolve/org.freedesktop.resolve1.policy +src/timedate/org.freedesktop.timedate1.policy src/core/dbus-unit.c diff --git a/po/POTFILES.skip b/po/POTFILES.skip index b56a9984c4..e6ef4d7920 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -12,9 +12,9 @@ src/core/dbus-target.c src/core/dbus-timer.c src/core/dbus-unit.c src/core/dbus-scope.c +src/core/org.freedesktop.systemd1.policy src/hostname/hostnamed.c src/locale/localed.c -src/core/org.freedesktop.systemd1.policy.in src/timedate/timedated.c units/user@.service.in units/debug-shell.service.in From b0faead2501cd539767dc11d098c08f5730224ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 18 Feb 2018 17:39:08 +0100 Subject: [PATCH 6/6] meson: fix systemd-pot target when polkit-devel is not installed To successfully extract strings from our .policy files, gettext needs polkit.{its,loc} files provided by policykit-devel. When that package is not installed, systemd-pot would fail to extract strings: [0/1] Running external command systemd-pot. xgettext: warning: file 'src/core/org.freedesktop.systemd1.policy.in.in' extension 'policy' is unknown; will try C xgettext: warning: file 'src/hostname/org.freedesktop.hostname1.policy.in' extension 'policy' is unknown; will try C ... We now don't need the .its and .loc files for normal building, but they are still useful when generating the .pot file, because that way we avoid the dependency on sufficiently new polkit. We just need to tell i18n to pass their location to xgettext. --- po/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/meson.build b/po/meson.build index 7ba08fba18..01ab7a3a54 100644 --- a/po/meson.build +++ b/po/meson.build @@ -16,6 +16,6 @@ # along with systemd; If not, see . i18n = import('i18n') -i18n.gettext(meson.project_name(), preset: 'glib') - -po_dir = meson.current_source_dir() +i18n.gettext(meson.project_name(), + preset : 'glib', + data_dirs : '.')