NACK: [Unstable/Lunar][PATCH] UBUNTU: [Config] debian/rules: 1-maintainer.mk -- Use make's if-else

Juerg Haefliger juerg.haefliger at canonical.com
Thu Jan 26 10:49:09 UTC 2023


Doesn't apply cleanly and has wrong subject. Will send a v2.

...Juerg


> Use make's built-in if-else conditional rather than the shell's so we
> can drop multi-line shell statements and make the code more readable.
> 
> While at it, don't purge the 'build' directory at the end of the config
> operations. That's a directory used internally by the kernelconfig script
> which handles the cleanup.
> 
> Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
> ---
>  debian/rules.d/1-maintainer.mk | 38 +++++++++++++++++-----------------
>  1 file changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
> index 239af468df5d..e90d4792ce58 100644
> --- a/debian/rules.d/1-maintainer.mk
> +++ b/debian/rules.d/1-maintainer.mk
> @@ -27,31 +27,31 @@ printdebian:
>  
>  .PHONY: migrateconfigs
>  migrateconfigs:
> -	dh_testdir;
> -	if [ -e "$(DEBIAN)/config/config.common.ubuntu" ]; then \
> -		conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/old-kernelconfig genconfigs; \
> -		mkdir build; \
> -		mv $(DEBIAN)/config/annotations build/.annotations ; \
> -		mv $(DEBIAN)/config/README.rst build/.README.rst 2>/dev/null || true; \
> -		rm -rf $(DEBIAN)/config; \
> -		mkdir -p $(DEBIAN)/config; \
> -		debian/scripts/misc/migrate-annotations < build/.annotations > $(DEBIAN)/config/annotations; \
> -		mv build/.README.rst $(DEBIAN)/config/README.rst 2>/dev/null || true; \
> -		conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/kernelconfig updateconfigs; \
> -	fi
> +ifneq ($(wildcard $(DEBIAN)/config/config.common.ubuntu),)
> +	dh_testdir
> +	conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/old-kernelconfig genconfigs
>  	rm -rf build
> +	mkdir build
> +	mv $(DEBIAN)/config/annotations build/.annotations
> +	mv $(DEBIAN)/config/README.rst build/.README.rst 2>/dev/null || true
> +	rm -rf $(DEBIAN)/config
> +	mkdir -p $(DEBIAN)/config
> +	debian/scripts/misc/migrate-annotations < build/.annotations > $(DEBIAN)/config/annotations
> +	mv build/.README.rst $(DEBIAN)/config/README.rst 2>/dev/null || true
> +	rm -rf build
> +	conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/kernelconfig updateconfigs
> +endif
>  
>  configs-targets := updateconfigs defaultconfigs genconfigs editconfigs
>  
>  .PHONY: $(configs-targets)
>  $(configs-targets):
> -	dh_testdir;
> -	if [ -e "$(DEBIAN)/config/config.common.ubuntu" ]; then \
> -		conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/old-kernelconfig $@; \
> -	else \
> -		conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/kernelconfig $@; \
> -	fi;
> -	rm -rf build
> +	dh_testdir
> +ifneq ($(wildcard $(DEBIAN)/config/config.common.ubuntu),)
> +	conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/old-kernelconfig $@
> +else
> +	conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/kernelconfig $@
> +endif
>  
>  .PHONY: printenv
>  printenv:

-------------- 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/20230126/9ab8108f/attachment.sig>


More information about the kernel-team mailing list