1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
Upstream-URL: https://gitlab.com/lvmteam/lvm2/-/merge_requests/29
From b0b259e3571b5be49d912e56518c9af734f317d4 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Mon, 2 Jun 2025 04:08:08 +0000
Subject: [PATCH] configure: Use portable string comparison
= and == are equivalent in Bash for strings, but = is the only portable
operator for compatibility with other shells. Before this change,
running ./configure with Dash as /bin/sh resulted in:
./configure: 14558: test: yes: unexpected operator
and the test did not work (i.e. --enable-cmdlib --disable-shared allowed
a failed build to continue). Now, the test works in Bash and Dash.
---
configure | 2 +-
configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 342bd0047..75564a228 100755
--- a/configure
+++ b/configure
@@ -14564,7 +14564,7 @@ printf %s "checking whether to compile liblvm2cmd.so... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CMDLIB" >&5
printf "%s\n" "$CMDLIB" >&6; }
-if test "$CMDLIB" == "yes" && test "$SHARED_LINK" = "no"
+if test "$CMDLIB" = "yes" && test "$SHARED_LINK" = "no"
then :
as_fn_error $? "--enable-cmdlib requires dynamic linking." "$LINENO" 5
fi
diff --git a/configure.ac b/configure.ac
index 6fcf6f2b5..470057be4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1395,7 +1395,7 @@ AS_IF([test "$CMDLIB" != "yes"], [CMDLIB="no" LVM2CMD_LIB=], [LVM2CMD_LIB="-llvm
AC_MSG_CHECKING([whether to compile liblvm2cmd.so])
AC_MSG_RESULT([$CMDLIB])
-AS_IF([test "$CMDLIB" == "yes" && test "$SHARED_LINK" = "no"],
+AS_IF([test "$CMDLIB" = "yes" && test "$SHARED_LINK" = "no"],
[AC_MSG_ERROR([--enable-cmdlib requires dynamic linking.])])
--
2.40.0
|