2014-09-04 14:55 GMT+02:00 Michael Biebl <mbi...@gmail.com>:
> 2014-09-04 14:31 GMT+02:00 Zbigniew Jędrzejewski-Szmek <zbys...@in.waw.pl>:
>> On Thu, Sep 04, 2014 at 02:14:23PM +0200, Michael Biebl wrote:
>>> Hi,
>>>
>>> 2014-09-04 6:16 GMT+02:00 Zbigniew Jędrzejewski-Szmek <zbys...@in.waw.pl>:
>>> > On Wed, Sep 03, 2014 at 11:51:58PM +0200, Michael Biebl wrote:
>>>
>>> >>  define add-wants
>>> >> -     [ -z "$$what" ] || ( \
>>> >> +     [ -z "$$what" ] || ! echo $$what | grep -q '[^[:space:]]' || ( \
>>> > Maybe we could use something simpler like
>>> >         [[ $what =~ ^[[:space:]]*$ ]] || ( \
>>>
>>> I didn't want to use a bash specific feature here, since /bin/sh is
>>> not guaranteed to point to bash.
>>> So I guess using grep is the safer choice and I'd like to keep that as is.
>> What about folding the first case into the grep pattern then?
>
> Since I didn't think this improved readability, I kept this as-is for now.

After reworking the patch as you suggested I realized, that bit is
actually not strictly necessary anymore,  as I use a different install
hook for busname units now.

So I dropped it again and updated the commit message accordingly.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From 96c254befc0533947a4aeed83a3b252f199345ea Mon Sep 17 00:00:00 2001
From: Michael Biebl <bi...@debian.org>
Date: Wed, 3 Sep 2014 23:34:29 +0200
Subject: [PATCH] build: don't install busname units and target if kdbus
 support is disabled

---
 Makefile.am | 45 +++++++++++++++++++++++++++++++++------------
 1 file changed, 33 insertions(+), 12 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 58e5ce6..b04d44a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -140,6 +140,7 @@ nodist_pkgsysconf_DATA =
 dist_pkgdata_DATA =
 dist_dbuspolicy_DATA =
 dist_dbussystemservice_DATA =
+dist_systemunit_DATA_busnames =
 check_PROGRAMS =
 check_DATA =
 tests=
@@ -263,10 +264,12 @@ install-target-wants-hook:
 	what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
 	what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
 	what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
-	what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
 	what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
 	what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
 	what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
+
+install-target-wants-hook-busnames:
+	what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
 	what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
 
 define add-wants
@@ -316,6 +319,11 @@ INSTALL_EXEC_HOOKS += \
 	install-aliases-hook \
 	install-touch-usr-hook
 
+if ENABLE_KDBUS
+INSTALL_EXEC_HOOKS += \
+	install-target-wants-hook-busnames
+endif
+
 # ------------------------------------------------------------------------------
 AM_V_M4 = $(AM_V_M4_$(V))
 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
@@ -463,7 +471,6 @@ dist_systemunit_DATA = \
 	units/sigpwr.target \
 	units/sleep.target \
 	units/sockets.target \
-	units/busnames.target \
 	units/timers.target \
 	units/paths.target \
 	units/suspend.target \
@@ -491,6 +498,14 @@ dist_systemunit_DATA = \
 	units/system-update.target \
 	units/initrd-switch-root.target
 
+if ENABLE_KDBUS
+dist_systemunit_DATA += \
+	$(dist_systemunit_DATA_busnames)
+endif
+
+dist_systemunit_DATA_busnames += \
+	units/busnames.target
+
 nodist_systemunit_DATA = \
 	units/getty@.service \
 	units/serial-getty@.service \
@@ -4486,7 +4501,7 @@ rootlibexec_PROGRAMS += \
 nodist_systemunit_DATA += \
 	units/systemd-hostnamed.service
 
-dist_systemunit_DATA += \
+dist_systemunit_DATA_busnames += \
 	units/org.freedesktop.hostname1.busname
 
 dist_dbuspolicy_DATA += \
@@ -4529,13 +4544,11 @@ EXTRA_DIST += \
 	units/systemd-hostnamed.service.in
 
 # ------------------------------------------------------------------------------
-if ENABLE_KDBUS
-dist_systemunit_DATA += \
+dist_systemunit_DATA_busnames += \
 	units/org.freedesktop.systemd1.busname
 
 BUSNAMES_TARGET_WANTS += \
 	org.freedesktop.systemd1.busname
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOCALED
@@ -4550,7 +4563,7 @@ systemd_localed_LDADD = \
 nodist_systemunit_DATA += \
 	units/systemd-localed.service
 
-dist_systemunit_DATA += \
+dist_systemunit_DATA_busnames += \
 	units/org.freedesktop.locale1.busname
 
 rootlibexec_PROGRAMS += \
@@ -4625,7 +4638,7 @@ dist_dbuspolicy_DATA += \
 nodist_systemunit_DATA += \
 	units/systemd-timedated.service
 
-dist_systemunit_DATA += \
+dist_systemunit_DATA_busnames += \
 	units/org.freedesktop.timedate1.busname
 
 polkitpolicy_files += \
@@ -4787,7 +4800,9 @@ nodist_systemunit_DATA += \
 	units/systemd-machined.service
 
 dist_systemunit_DATA += \
-	units/machine.slice \
+	units/machine.slice
+
+dist_systemunit_DATA_busnames += \
 	units/org.freedesktop.machine1.busname
 
 dist_dbussystemservice_DATA += \
@@ -4897,7 +4912,7 @@ rootlibexec_PROGRAMS += \
 nodist_systemunit_DATA += \
 	units/systemd-resolved.service
 
-dist_systemunit_DATA += \
+dist_systemunit_DATA_busnames += \
 	units/org.freedesktop.resolve1.busname
 
 dist_dbuspolicy_DATA += \
@@ -5289,7 +5304,9 @@ nodist_systemunit_DATA += \
 	units/systemd-user-sessions.service
 
 dist_systemunit_DATA += \
-	units/user.slice \
+	units/user.slice
+
+dist_systemunit_DATA_busnames += \
 	units/org.freedesktop.login1.busname
 
 dist_dbussystemservice_DATA += \
@@ -5903,7 +5920,6 @@ SYSTEM_UNIT_ALIASES += \
 USER_UNIT_ALIASES += \
 	$(systemunitdir)/shutdown.target shutdown.target \
 	$(systemunitdir)/sockets.target sockets.target \
-	$(systemunitdir)/busnames.target busnames.target \
 	$(systemunitdir)/timers.target timers.target \
 	$(systemunitdir)/paths.target paths.target \
 	$(systemunitdir)/bluetooth.target bluetooth.target \
@@ -5911,6 +5927,11 @@ USER_UNIT_ALIASES += \
 	$(systemunitdir)/sound.target sound.target \
 	$(systemunitdir)/smartcard.target smartcard.target
 
+if ENABLE_KDBUS
+USER_UNIT_ALIASES += \
+	$(systemunitdir)/busnames.target busnames.target
+endif
+
 GENERAL_ALIASES += \
 	$(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
 	$(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
-- 
2.1.0

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to