diff mbox series

[v2,1/2] coreutils: rewrite for loop with foreach

Message ID 20180401153905.14483-2-thomas.petazzoni@bootlin.com
State Accepted
Commit 225c8aaf27af908ce8a9ef5fb3fde4eb9d0cdc94
Headers show
Series Switch coreutils to symlink method | expand

Commit Message

Thomas Petazzoni April 1, 2018, 3:39 p.m. UTC
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>
---
 package/coreutils/coreutils.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Peter Korsgaard April 1, 2018, 8:52 p.m. UTC | #1
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > 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>

Committed, thanks.
diff mbox series

Patch

diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk
index 8259f42f4a..8880e77dcc 100644
--- a/package/coreutils/coreutils.mk
+++ b/package/coreutils/coreutils.mk
@@ -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