package/ebtables: use a foreach make loop instead of a for shell loop
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 22 Dec 2019 20:17:36 +0000 (21:17 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 22 Dec 2019 21:25:58 +0000 (22:25 +0100)
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

index 7b2264703c275bbc72acf40ac3d0fab7b0c5dd78..9a975cc7a15724d48942a09ed3fc74c397e3fa76 100644 (file)
@@ -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