[L/unstable 06/13] UBUNTU: [Packaging] simplify custom_override
Juerg Haefliger
juerg.haefliger at canonical.com
Wed Dec 7 06:54:11 UTC 2022
On Mon, 5 Dec 2022 17:56:12 +0900
Masahiro Yamada <masahiro.yamada at canonical.com> wrote:
> You do not need to invoke the shell for if/else choice.
>
> You can do it by using the $(if ...) built-in function.
>
> $(if $($(1)_$(2)),$($(1)_$(2)),$($(1)))
>
> GNU Make >= 3.81 supports $(or ...), so the code can be even simpler:
>
> $(or $($(1)_$(2)),$($(1)))
>
> No functional change is intended.
>
> Signed-off-by: Masahiro Yamada <masahiro.yamada at canonical.com>
> ---
> debian/rules.d/0-common-vars.mk | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
> index a54b83dd943b..ec9c5680493b 100644
> --- a/debian/rules.d/0-common-vars.mk
> +++ b/debian/rules.d/0-common-vars.mk
> @@ -278,8 +278,7 @@ LN = ln -sf
>
> # Checks if a var is overriden by the custom rules. Called with var and
> # flavour as arguments.
> -custom_override = \
> - $(shell if [ -n "$($(1)_$(2))" ]; then echo "$($(1)_$(2))"; else echo "$($(1))"; fi)
> +custom_override = $(or $($(1)_$(2)),$($(1)))
Maybe add a note/comment what this is doing.
...Juerg
> # selftests that Ubuntu cares about
> ubuntu_selftests = breakpoints cpu-hotplug efivarfs memfd memory-hotplug mount net ptrace seccomp timers powerpc user ftrace
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20221207/d92eb0c3/attachment.sig>
More information about the kernel-team
mailing list