Patchwork [v2,3/3] rootfs-overlay: use a make foreach instead of a shell for

login
register
mail settings
Submitter Luca Ceresoli
Date April 8, 2013, 4:50 p.m.
Message ID <1365439816-6935-4-git-send-email-luca@lucaceresoli.net>
Download mbox | patch
Permalink /patch/234842/
State Accepted
Headers show

Comments

Luca Ceresoli - April 8, 2013, 4:50 p.m.
Makes the code uniform with the post-build and post-image implementation
(which is slightly simpler and, presumably, more efficient).

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 Makefile |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Yann E. MORIN - April 16, 2013, 9:55 p.m.
Luca, All,

On Mon, Apr 08, 2013 at 06:50:16PM +0200, Luca Ceresoli wrote:
> Makes the code uniform with the post-build and post-image implementation
> (which is slightly simpler and, presumably, more efficient).
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

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

(not tested, I don't have rootfs overlays).

Regards,
Yann E. MORIN.
Arnout Vandecappelle - April 30, 2013, 4:59 p.m.
On 08/04/13 18:50, Luca Ceresoli wrote:
> Makes the code uniform with the post-build and post-image implementation
> (which is slightly simpler and, presumably, more efficient).
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

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

  I thought about the possibility to refactor these three use cases into 
a single make function, but it would actually just complicate things.

  Regards,
  Arnout

> ---
>   Makefile |    7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f475d1b..a3b98f3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -501,13 +501,12 @@ endif
>   		echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
>   	) >  $(TARGET_DIR)/etc/os-release
>
> -	@for dir in $(call qstrip,$(BR2_ROOTFS_OVERLAY)); do \
> -		$(call MESSAGE,"Copying overlay $${dir}"); \
> +	@$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
> +		$(call MESSAGE,"Copying overlay $(d)"); \
>   		rsync -a \
>   			--exclude .empty --exclude .svn --exclude .git \
>   			--exclude .hg --exclude '*~' \
> -			$${dir}/ $(TARGET_DIR); \
> -	done
> +			$(d)/ $(TARGET_DIR)$(sep))
>
>   	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
>   		$(call MESSAGE,"Executing  post-build script $(s)"); \
>
Peter Korsgaard - April 30, 2013, 8:33 p.m.
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 Arnout> On 08/04/13 18:50, Luca Ceresoli wrote:
 >> Makes the code uniform with the post-build and post-image implementation
 >> (which is slightly simpler and, presumably, more efficient).
 >> 
 >> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

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

Committed, thanks.
Luca Ceresoli - May 2, 2013, 7:30 a.m.
Arnout Vandecappelle wrote:
> On 08/04/13 18:50, Luca Ceresoli wrote:
>> Makes the code uniform with the post-build and post-image implementation
>> (which is slightly simpler and, presumably, more efficient).
>>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
>  I thought about the possibility to refactor these three use cases 
> into a single make function, but it would actually just complicate 
> things.

I considered this as well, but for so few lines it would be overkill.

Thanks for your review,
Luca

Patch

diff --git a/Makefile b/Makefile
index f475d1b..a3b98f3 100644
--- a/Makefile
+++ b/Makefile
@@ -501,13 +501,12 @@  endif
 		echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \
 	) >  $(TARGET_DIR)/etc/os-release
 
-	@for dir in $(call qstrip,$(BR2_ROOTFS_OVERLAY)); do \
-		$(call MESSAGE,"Copying overlay $${dir}"); \
+	@$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
+		$(call MESSAGE,"Copying overlay $(d)"); \
 		rsync -a \
 			--exclude .empty --exclude .svn --exclude .git \
 			--exclude .hg --exclude '*~' \
-			$${dir}/ $(TARGET_DIR); \
-	done
+			$(d)/ $(TARGET_DIR)$(sep))
 
 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
 		$(call MESSAGE,"Executing  post-build script $(s)"); \