diff mbox series

[1/2] rt-tests: Put variables in test-feature in quotes

Message ID 20241204154004.560615-2-tglozar@redhat.com
State New
Headers show
Series rt-tests: libcpupower feature detection fixes | expand

Commit Message

Tomas Glozar Dec. 4, 2024, 3:40 p.m. UTC
From: Tomas Glozar <tglozar@redhat.com>

test-feature passes several variables (OBJDIR, CFLAGS, CPPFLAGS,
LDFLAGS) to make via a shell command from inside the Makefile. If there
are spaces in either of these, it gets parsed as a second argument
to make and feature detection fails.

Add quotes around the values to prevent them being passed as multiple
arguments.

Signed-off-by: Tomas Glozar <tglozar@redhat.com>
---
 feature/test-feature.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

John Kacur Dec. 6, 2024, 4:11 p.m. UTC | #1
On Wed, 4 Dec 2024, tglozar@redhat.com wrote:

> From: Tomas Glozar <tglozar@redhat.com>
> 
> test-feature passes several variables (OBJDIR, CFLAGS, CPPFLAGS,
> LDFLAGS) to make via a shell command from inside the Makefile. If there
> are spaces in either of these, it gets parsed as a second argument
> to make and feature detection fails.
> 
> Add quotes around the values to prevent them being passed as multiple
> arguments.
> 
> Signed-off-by: Tomas Glozar <tglozar@redhat.com>
> ---
>  feature/test-feature.mak | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/feature/test-feature.mak b/feature/test-feature.mak
> index 0b3e51c..aef915a 100644
> --- a/feature/test-feature.mak
> +++ b/feature/test-feature.mak
> @@ -1,5 +1,5 @@
>  # SPDX-License-Identifier: GPL-2.0-or-later
>  define test-feature
> -$(shell $(MAKE) OBJDIR=$(OBJDIR) CFLAGS=$(CFLAGS) CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) \
> +$(shell $(MAKE) OBJDIR="$(OBJDIR)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
>  -f feature/Makefile feature-$1 clean >/dev/null 2>/dev/null; echo $$?)
>  endef
> -- 
> 2.47.0
> 
> 
> 
Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/feature/test-feature.mak b/feature/test-feature.mak
index 0b3e51c..aef915a 100644
--- a/feature/test-feature.mak
+++ b/feature/test-feature.mak
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: GPL-2.0-or-later
 define test-feature
-$(shell $(MAKE) OBJDIR=$(OBJDIR) CFLAGS=$(CFLAGS) CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) \
+$(shell $(MAKE) OBJDIR="$(OBJDIR)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
 -f feature/Makefile feature-$1 clean >/dev/null 2>/dev/null; echo $$?)
 endef