X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/83b31e078f713ebc761f90030d71e12618bd68ad..f21c103e5a69f7e6c18fc33fc6da1940f2307c60:/include/scan.mk?ds=inline diff --git a/include/scan.mk b/include/scan.mk index 19350b612..b2b202d12 100644 --- a/include/scan.mk +++ b/include/scan.mk @@ -27,7 +27,12 @@ define PackageDir { \ $$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \ echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \ - $(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || echo "ERROR: please fix $(SCAN_DIR)/$(2)/Makefile" >&2; \ + $(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \ + mkdir -p "$(TOPDIR)/logs/$(SCAN_DIR)/$(2)"; \ + $(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) > $(TOPDIR)/logs/$(SCAN_DIR)/$(2)/dump.txt 2>&1; \ + $$(call progress,ERROR: please fix $(SCAN_DIR)/$(2)/Makefile - see logs/$(SCAN_DIR)/$(2)/dump.txt for details\n) \ + rm -f $$@; \ + }; \ echo; \ } > $$@ || true endef @@ -52,7 +57,7 @@ $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST) $(TARGET_STAMP):: +( \ $(NO_TRACE_MAKE) $(FILELIST); \ - MD5SUM=$$(cat $(FILELIST) | (md5sum || md5) | awk '{print $$1}'); \ + MD5SUM=$$(cat $(FILELIST) | (md5sum || md5) 2>/dev/null | awk '{print $$1}'); \ [ -f "$@.$$MD5SUM" ] || { \ rm -f $@.*; \ touch $@.$$MD5SUM; \ @@ -62,7 +67,7 @@ $(TARGET_STAMP):: $(TMP_DIR)/.$(SCAN_TARGET): $(TARGET_STAMP) $(SCAN_STAMP) $(call progress,Collecting $(SCAN_NAME) info: merging...) - cat $(FILELIST) | awk '{gsub(/\//, "_", $$0);print "$(TMP_DIR)/info/.$(SCAN_TARGET)-" $$0}' | xargs cat > $@ + -cat $(FILELIST) | awk '{gsub(/\//, "_", $$0);print "$(TMP_DIR)/info/.$(SCAN_TARGET)-" $$0}' | xargs cat > $@ 2>/dev/null $(call progress,Collecting $(SCAN_NAME) info: done) echo