aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Beckett <john.beckett@net2edge.com>2020-09-21 13:34:17 +0100
committerPaul Spooren <mail@aparcar.org>2020-12-07 10:55:59 -1000
commit36e0268aa67bb757d7b9b39cbe1e7f89332f6746 (patch)
tree49bd2d1ffbb5ed275533397e3eb911352a8a433c
parentf7d7a3a18b1f1d1fdcf5b05f4ab1af6b8fc2ce1e (diff)
downloadupstream-36e0268aa67bb757d7b9b39cbe1e7f89332f6746.tar.gz
upstream-36e0268aa67bb757d7b9b39cbe1e7f89332f6746.tar.bz2
upstream-36e0268aa67bb757d7b9b39cbe1e7f89332f6746.zip
build: find_md5 list with mod time and sorted
It was observed that the MD5 would not change after source files had been modified, looking deeper into the build process it was discovered that find_md5 build function makes a list of the files being built and then passes the list to a summing utility on stdin. The resultant MD5 is of the file list, not the contents of the files. The MD5 would change if the ordering of the list changed, or items were removed or deleted. The proposed fix is to add the modification time after the filename and then sort the list to prevent find returning files in a different order falsely re-triggering a rebuild. The MD5 will now change when a file is modified or files are added/removed from the list. Using 'T@' to show time in epoch for timezone independent behaviour. Signed-off-by: John Beckett <john.beckett@net2edge.com>
-rw-r--r--include/depends.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/depends.mk b/include/depends.mk
index 3df51adae3..ace7139000 100644
--- a/include/depends.mk
+++ b/include/depends.mk
@@ -13,7 +13,7 @@
DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*"
-find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) | mkhash md5
+find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | mkhash md5
define rdep
.PRECIOUS: $(2)