Skip to content

Commit 8397267

Browse files
committed
imagebuilder: companion fix for redundant abi-versioned packages hack
The find command fails if the same files are overwrite by itself: ... find /workdir/bin/targets/malta/le/packages /workdir/bin/packages/mipsel_24kc/base /workdir/bin/packages/mipsel_24kc/luci /workdir/bin/packages/mipsel_24kc/packages /workdir/bin/packages/mipsel_24kc/routing /workdir/bin/packages/mipsel_24kc/telephony /workdir/bin/packages/mipsel_24kc/video -type f -name '*.apk' \ -exec cp -fpR -t /workdir/build_dir/target-mipsel_24kc_musl/openwrt-imagebuilder-malta-le.Linux-x86_64/packages/ {} + cp: will not overwrite just-created '/workdir/build_dir/target-mipsel_24kc_musl/openwrt-imagebuilder-malta-le.Linux-x86_64/packages/libext2fs2-1.47.3-r1.apk' with '/workdir/bin/packages/mipsel_24kc/base/libext2fs2-1.47.3-r1.apk' cp: will not overwrite just-created '/workdir/build_dir/target-mipsel_24kc_musl/openwrt-imagebuilder-malta-le.Linux-x86_64/packages/libcomerr0-1.47.3-r1.apk' with '/workdir/bin/packages/mipsel_24kc/base/libcomerr0-1.47.3-r1.apk' cp: will not overwrite just-created '/workdir/build_dir/target-mipsel_24kc_musl/openwrt-imagebuilder-malta-le.Linux-x86_64/packages/libe2p2-1.47.3-r1.apk' with '/workdir/bin/packages/mipsel_24kc/base/libe2p2-1.47.3-r1.apk' cp: will not overwrite just-created '/workdir/build_dir/target-mipsel_24kc_musl/openwrt-imagebuilder-malta-le.Linux-x86_64/packages/libjson-c5-0.18-r1.apk' with '/workdir/bin/packages/mipsel_24kc/base/libjson-c5-0.18-r1.apk' ... Since the "find + exex $(CP)" is intented to execute cp with -f flag for overwrites, it should success in that case or at least not fail. Change to a equivalent "rsync" command which does it correctly. This is needed for the new "shared" abi-versioned packages which are going to appear in two directories after the other commit included in this PR/series is applied. After: rsync -a --include='*.apk' --exclude='*' \ /workdir/bin/targets/malta/le/packages/ /workdir/bin/packages/mipsel_24kc/base/ /workdir/bin/packages/mipsel_24kc/luci/ /workdir/bin/packages/mipsel_24kc/packages/ /workdir/bin/packages/mipsel_24kc/routing/ /workdir/bin/packages/mipsel_24kc/telephony/ /workdir/bin/packages/mipsel_24kc/video/ \ /workdir/build_dir/target-mipsel_24kc_musl/openwrt-imagebuilder-malta-le.Linux-x86_64/packages/ Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
1 parent 5a65576 commit 8397267

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

target/imagebuilder/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ ifeq ($(CONFIG_IB_STANDALONE),)
7676
-name 'kernel$(PACKAGE_VERSION_SEPARATOR)*.$(PACKAGE_SUFFIX)' \) \
7777
-exec $(CP) -t $(PKG_BUILD_DIR)/packages {} +
7878
else
79-
$(FIND) $(wildcard $(PACKAGE_SUBDIRS)) -type f -name '*.$(PACKAGE_SUFFIX)' \
80-
-exec $(CP) -t $(PKG_BUILD_DIR)/packages/ {} +
79+
rsync -a --include='*.$(PACKAGE_SUFFIX)' --exclude='*' \
80+
$(foreach dir,$(wildcard $(PACKAGE_SUBDIRS)),$(dir)/) \
81+
$(PKG_BUILD_DIR)/packages/
8182
endif
8283

8384
ifneq ($(CONFIG_SIGNATURE_CHECK),)

0 commit comments

Comments
 (0)