浏览代码

coreutils: rewrite for loop with foreach

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>
Thomas Petazzoni 7 年之前
父节点
当前提交
225c8aaf27
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      package/coreutils/coreutils.mk

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