device-mapper-multipath/0009-multipath-tools-Makefile.inc-simplify-expression-for.patch

37 lines
1.3 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 27 Oct 2022 16:34:34 +0200
Subject: [PATCH] multipath-tools: Makefile.inc: simplify expression for
SYSTEMD
Use a shell "or" function here. Note the use of "strip" to remove
the whitespace that are caused by the line break.
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
Makefile.inc | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index f3c84771..1a08b8fa 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -28,14 +28,8 @@ ifeq ($(TOPDIR),)
TOPDIR = ..
endif
-ifeq ($(shell $(PKGCONFIG) --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
- SYSTEMD = $(shell $(PKGCONFIG) --modversion libsystemd | awk '{print $$1}')
-else
- ifeq ($(shell systemctl --version >/dev/null 2>&1 && echo 1), 1)
- SYSTEMD = $(shell systemctl --version 2> /dev/null | \
- sed -n 's/systemd \([0-9]*\).*/\1/p')
- endif
-endif
+SYSTEMD := $(strip $(or $(shell $(PKGCONFIG) --modversion libsystemd 2>/dev/null | awk '{print $$1}'), \
+ $(shell systemctl --version 2>/dev/null | sed -n 's/systemd \([0-9]*\).*/\1/p')))
# Allow user to override default location.