aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-23 20:59:13 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-01-23 20:59:13 +0000
commit26c3d87db090c2f64cbd19818bd4ec6275303ac5 (patch)
treec66e6c79947974ac9c5d4e4d5fea18d893280bf3
parenta15b4bf6fc2805d91653e609291a100e232c7f0c (diff)
downloadupstream-26c3d87db090c2f64cbd19818bd4ec6275303ac5.tar.gz
upstream-26c3d87db090c2f64cbd19818bd4ec6275303ac5.tar.bz2
upstream-26c3d87db090c2f64cbd19818bd4ec6275303ac5.zip
allow files/ to overwrite existing symlinks (fixes #3508)
SVN-Revision: 25078
-rw-r--r--package/Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/Makefile b/package/Makefile
index 786edd49f0..8e8c6c9a63 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -64,6 +64,14 @@ endif
$(curdir)/rootfs-prepare: $(TMP_DIR)/.build
@-$(MAKE) package/preconfig
@if [ -d $(TOPDIR)/files ]; then \
+ ( cd $(TOPDIR)/files; find -type f ) | \
+ ( cd $(TARGET_DIR); while :; do \
+ read FILE; \
+ [ -z "$$FILE" ] && break; \
+ [ -L "$$FILE" ] || continue; \
+ echo "Removing symlink $(TARGET_DIR)/$$FILE"; \
+ rm -f "$$FILE"; \
+ done; ); \
$(CP) $(TOPDIR)/files/. $(TARGET_DIR); \
fi
@mkdir -p $(TARGET_DIR)/etc/rc.d