diff mbox

[v2,1/3] post-build: show each script filename before execution

Message ID 1365439816-6935-2-git-send-email-luca@lucaceresoli.net
State Accepted
Headers show

Commit Message

Luca Ceresoli April 8, 2013, 4:50 p.m. UTC
This also simplifies code by removing the ifneq/endif clauses.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 Makefile |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Yann E. MORIN April 16, 2013, 9:49 p.m. UTC | #1
Luca, All,

On Mon, Apr 08, 2013 at 06:50:14PM +0200, Luca Ceresoli wrote:
> This also simplifies code by removing the ifneq/endif clauses.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Very usefull, indeed.

Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN
Arnout Vandecappelle April 17, 2013, 4:13 p.m. UTC | #2
On 08/04/13 18:50, Luca Ceresoli wrote:
> This also simplifies code by removing the ifneq/endif clauses.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>   Makefile |    4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index c95bb1e..75f0f0c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -509,11 +509,9 @@ endif
>   			$${dir}/ $(TARGET_DIR); \
>   	done
>
> -ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
> -	@$(call MESSAGE,"Executing post-build script\(s\)")
>   	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
> +		$(call MESSAGE,"Executing  post-build script $(s)"); \
>   		$(s) $(TARGET_DIR)$(sep))
> -endif

  I wonder, if there are multiple scripts, won't the second MESSAGE be 
echoed by make? I had expected that the @ would only apply to the first 
line when they are separated with $(sep), and that each invocation would 
run in a separate shell.

  By the way, a very simple alternative would be to remove the @ in front 
of the foreach, then each script invocation will be echoed by make.


  Regards,
  Arnout

>
>   ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
>   LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
>
Yann E. MORIN April 18, 2013, 7:14 a.m. UTC | #3
Arnout, Luca, All,

On Wednesday 17 April 2013 18:13:33 Arnout Vandecappelle wrote:
> On 08/04/13 18:50, Luca Ceresoli wrote:
> > This also simplifies code by removing the ifneq/endif clauses.
> >
> > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> > ---
> >   Makefile |    4 +---
> >   1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index c95bb1e..75f0f0c 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -509,11 +509,9 @@ endif
> >   			$${dir}/ $(TARGET_DIR); \
> >   	done
> >
> > -ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
> > -	@$(call MESSAGE,"Executing post-build script\(s\)")
> >   	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
> > +		$(call MESSAGE,"Executing  post-build script $(s)"); \
> >   		$(s) $(TARGET_DIR)$(sep))
> > -endif
> 
>   I wonder, if there are multiple scripts, won't the second MESSAGE be 
> echoed by make? I had expected that the @ would only apply to the first 
> line when they are separated with $(sep), and that each invocation would 
> run in a separate shell.

Well, it does work as expected: the two scripts I have are
properly echoed with:
>>> Executing  post-build script /blabla/script-1
[traces for script-1]
>>> Executing  post-build script /blabla/script-2
[traces for script-2]

>   By the way, a very simple alternative would be to remove the @ in front 
> of the foreach, then each script invocation will be echoed by make.

Indeed, but I also like the highlighted trace. It makes it easier to spot
the scripts traces.

Regards,
Yann E. MORIN.
Peter Korsgaard April 24, 2013, 8:15 p.m. UTC | #4
>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:

 Luca> This also simplifies code by removing the ifneq/endif clauses.
 Luca> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
 Luca> ---
 Luca>  Makefile |    4 +---
 Luca>  1 file changed, 1 insertion(+), 3 deletions(-)

 Luca> diff --git a/Makefile b/Makefile
 Luca> index c95bb1e..75f0f0c 100644
 Luca> --- a/Makefile
 Luca> +++ b/Makefile
 Luca> @@ -509,11 +509,9 @@ endif
 Luca>  			$${dir}/ $(TARGET_DIR); \
 Luca>  	done
 
 Luca> -ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
 Luca> -	@$(call MESSAGE,"Executing post-build script\(s\)")
 Luca>  	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
 Luca> +		$(call MESSAGE,"Executing  post-build script $(s)"); \
 Luca>  		$(s) $(TARGET_DIR)$(sep))

Double space after 'executing'. Committed with that fixed, thanks.
Luca Ceresoli April 26, 2013, 7:25 a.m. UTC | #5
Peter Korsgaard wrote:
>>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:
>   Luca> This also simplifies code by removing the ifneq/endif clauses.
>   Luca> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>   Luca> ---
>   Luca>  Makefile |    4 +---
>   Luca>  1 file changed, 1 insertion(+), 3 deletions(-)
>
>   Luca> diff --git a/Makefile b/Makefile
>   Luca> index c95bb1e..75f0f0c 100644
>   Luca> --- a/Makefile
>   Luca> +++ b/Makefile
>   Luca> @@ -509,11 +509,9 @@ endif
>   Luca>  			$${dir}/ $(TARGET_DIR); \
>   Luca>  	done
>   
>   Luca> -ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
>   Luca> -	@$(call MESSAGE,"Executing post-build script\(s\)")
>   Luca>  	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
>   Luca> +		$(call MESSAGE,"Executing  post-build script $(s)"); \
>   Luca>  		$(s) $(TARGET_DIR)$(sep))
>
> Double space after 'executing'. Committed with that fixed, thanks.

Ouch, thanks.

Luca
Arnout Vandecappelle April 30, 2013, 4:57 p.m. UTC | #6
On 08/04/13 18:50, Luca Ceresoli wrote:
> This also simplifies code by removing the ifneq/endif clauses.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

> ---
>   Makefile |    4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index c95bb1e..75f0f0c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -509,11 +509,9 @@ endif
>   			$${dir}/ $(TARGET_DIR); \
>   	done
>
> -ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
> -	@$(call MESSAGE,"Executing post-build script\(s\)")
>   	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
> +		$(call MESSAGE,"Executing  post-build script $(s)"); \
>   		$(s) $(TARGET_DIR)$(sep))
> -endif
>
>   ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
>   LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge
>
Peter Korsgaard April 30, 2013, 8:31 p.m. UTC | #7
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 Arnout> On 08/04/13 18:50, Luca Ceresoli wrote:
 >> This also simplifies code by removing the ifneq/endif clauses.
 >> 
 >> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

 Arnout> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

FYI, I applied this and the post-image patch on the 24th.
diff mbox

Patch

diff --git a/Makefile b/Makefile
index c95bb1e..75f0f0c 100644
--- a/Makefile
+++ b/Makefile
@@ -509,11 +509,9 @@  endif
 			$${dir}/ $(TARGET_DIR); \
 	done
 
-ifneq ($(BR2_ROOTFS_POST_BUILD_SCRIPT),"")
-	@$(call MESSAGE,"Executing post-build script\(s\)")
 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
+		$(call MESSAGE,"Executing  post-build script $(s)"); \
 		$(s) $(TARGET_DIR)$(sep))
-endif
 
 ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
 LOCALE_WHITELIST=$(BUILD_DIR)/locales.nopurge