[source] build: leaving behind incomplete metadata files on cancelled builds

LEDE Commits lede-commits at lists.infradead.org
Tue Oct 4 07:02:42 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/934901fb3e544e3c3ef66f6695bcf41293843bf3

commit 934901fb3e544e3c3ef66f6695bcf41293843bf3
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Oct 2 11:40:06 2016 +0200

    build: leaving behind incomplete metadata files on cancelled builds
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/scan.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/scan.mk b/include/scan.mk
index 5af0359..5bb263d 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -40,7 +40,8 @@ define PackageDir
 			rm -f $$@; \
 		}; \
 		echo; \
-	} > $$@ || true
+	} > $$@.tmp
+	mv $$@.tmp $$@
 endef
 
 $(OVERRIDELIST):
@@ -76,7 +77,8 @@ $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
 			print "$$(eval $$(call PackageDir," info "," dir "," pkg "))"; \
 		} ' < $<; \
 		true; \
-	) > $@
+	) > $@.tmp
+	mv $@.tmp $@
 
 -include $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk
 



More information about the lede-commits mailing list