diff mbox series

[2/2] Makefile: EXTPARSER sanity check

Message ID 20190312150538.11449-2-christian.storm@siemens.com
State Accepted
Headers show
Series [1/2] Makefile: SWDESCRIPTION sanity check | expand

Commit Message

Storm, Christian March 12, 2019, 3:05 p.m. UTC
Just like the SWDESCRIPTION sanity check, check for a non-empty
CONFIG_EXTPARSERNAME if CONFIG_SETEXTPARSERNAME it set. If not,
the external parser script cannot be loaded at run-time. Hence,
fail early at compile-time.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stefano Babic March 15, 2019, 11:02 a.m. UTC | #1
On 12/03/19 16:05, Christian Storm wrote:
> Just like the SWDESCRIPTION sanity check, check for a non-empty
> CONFIG_EXTPARSERNAME if CONFIG_SETEXTPARSERNAME it set. If not,
> the external parser script cannot be loaded at run-time. Hence,
> fail early at compile-time.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 1589bf6..6f1f509 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -383,6 +383,10 @@ cfg-sanity-check:
>  		echo "ERROR: CONFIG_SETSWDESCRIPTION set but not CONFIG_SWDESCRIPTION"; \
>  		exit 1; \
>  	fi
> +	@if [ "x$(CONFIG_SETEXTPARSERNAME)" = "xy" -a -z "$(patsubst "%",%,$(strip $(CONFIG_EXTPARSERNAME)))" ]; then \
> +		echo "ERROR: CONFIG_SETEXTPARSERNAME set but not CONFIG_EXTPARSERNAME"; \
> +		exit 1; \
> +	fi
>  
>  all: swupdate ${tools-bins} ${lua_swupdate}
>  
> 

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 1589bf6..6f1f509 100644
--- a/Makefile
+++ b/Makefile
@@ -383,6 +383,10 @@  cfg-sanity-check:
 		echo "ERROR: CONFIG_SETSWDESCRIPTION set but not CONFIG_SWDESCRIPTION"; \
 		exit 1; \
 	fi
+	@if [ "x$(CONFIG_SETEXTPARSERNAME)" = "xy" -a -z "$(patsubst "%",%,$(strip $(CONFIG_EXTPARSERNAME)))" ]; then \
+		echo "ERROR: CONFIG_SETEXTPARSERNAME set but not CONFIG_EXTPARSERNAME"; \
+		exit 1; \
+	fi
 
 all: swupdate ${tools-bins} ${lua_swupdate}