From c39626ec68b0cc5b5efd66aecfaf23992c762467 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 9 Jan 2023 09:59:27 +0200 Subject: Use proper macro conditional negation syntax in the manual Historically only %{!?foo} syntax has been used, the reversed ?! version was only introduced in 0d75ef1e0a0609ee61386f02fa311d6d8ac79450 (perhaps accidentally) and should not be used, much less recommended. (cherry picked from commit 7b0b5e7d2cf53817ec5e2545c5f591a26db72cec) --- docs/manual/macros.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/manual/macros.md b/docs/manual/macros.md index 14e287e70..ac891b07d 100644 --- a/docs/manual/macros.md +++ b/docs/manual/macros.md @@ -121,19 +121,19 @@ Sometimes it is useful to test whether a macro is defined or not. Syntax ``` %{?macro_name:value} -%{?!macro_name:value} +%{!?macro_name:value} ``` can be used for this purpose. `%{?macro_name:value}` is expanded to "value" if "macro_name" is defined, otherwise it is expanded to the empty string. -`%{?!macro_name:value}` is the negative variant. It is expanded to "value" +`%{!?macro_name:value}` negates the test. It is expanded to "value" if `macro_name` is not defined. Otherwise it is expanded to the empty string. Frequently used conditionally expanded macros are e.g. Define a macro if it is not defined: ``` -%{?!with_python3: %global with_python3 1} +%{!?with_python3: %global with_python3 1} ``` A macro that is expanded to 1 if "with_python3" is defined and 0 otherwise: -- cgit v1.2.1