[Buildroot] [git commit] package/ebtables: use a foreach make loop instead of a for shell loop

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: 2019-12-22 21:25:58
Subsystem: the rest · Maintainer: Linus Torvalds

commit: https://git.buildroot.net/buildroot/commit/?id=aa5d8a2b3fe3559db1256b8395561088e4500ba7
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

make loops are more commonly used in Buildroot, are shorter, and have
built-in error handling.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/ebtables/ebtables.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/package/ebtables/ebtables.mk b/package/ebtables/ebtables.mk
index 7b2264703c..9a975cc7a1 100644
--- a/package/ebtables/ebtables.mk
+++ b/package/ebtables/ebtables.mk
@@ -23,10 +23,10 @@ define EBTABLES_INSTALL_TARGET_CMDS
 endef
 else
 define EBTABLES_INSTALL_TARGET_CMDS
-	for so in $(@D)/*.so $(@D)/extensions/*.so; do \
-		$(INSTALL) -m 0755 -D $${so} \
-			$(TARGET_DIR)/lib/ebtables/`basename $${so}` || exit 1; \
-	done
+	$(foreach so,$(wildcard $(@D)/*.so $(@D)/extensions/*.so), \
+		$(INSTALL) -m 0755 -D $(so) \
+			$(TARGET_DIR)/lib/ebtables/$(notdir $(so))
+	)
 	$(INSTALL) -m 0755 -D $(@D)/ebtables $(TARGET_DIR)/sbin/ebtables
 	$(INSTALL) -m 0644 -D $(@D)/ethertypes $(TARGET_DIR)/etc/ethertypes
 endef
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help