]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
coreutils: rewrite for loop with foreach
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 1 Apr 2018 15:39:04 +0000 (17:39 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 1 Apr 2018 20:49:57 +0000 (22:49 +0200)
This brings up error checking at each iteration of the loop for free,
which removes the need for "|| exit 1".

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/coreutils/coreutils.mk

index 8259f42f4a6adff97e4394738ee4b66004765521..8880e77dccb72249e5ab0732249e53261b619c0f 100644 (file)
@@ -104,9 +104,9 @@ endif
 ifeq ($(BR2_ROOTFS_MERGED_USR),)
 define COREUTILS_CLEANUP_BIN
        # some things go in root rather than usr
-       for f in $(COREUTILS_BIN_PROGS); do \
-               mv -f $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f || exit 1; \
-       done
+       $(foreach f,$(COREUTILS_BIN_PROGS), \
+               mv -f $(TARGET_DIR)/usr/bin/$(f) $(TARGET_DIR)/bin/$(f)
+       )
 endef
 COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_CLEANUP_BIN
 endif