shithub: mc

Download patch

ref: aa1af3f1193ccd25a0b1ccb9318d3a6fc9b208e6
parent: bc6eee8cda8e13f265622b17a97998f923e486dd
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Sep 29 09:40:01 EDT 2014

Dump reasons for rebuild in debug.

--- a/build.myr
+++ b/build.myr
@@ -115,6 +115,10 @@
 				stale = true
 			;;
 			if !isfresh(d, out)
+				if opt_debug
+					std.put("Stale %s => %s\n", d, out);
+					pmtime(d, out)
+				;;
 				stale = true
 			;;
 		;;
@@ -277,6 +281,22 @@
 		-> srcsb.mtime.sec < dstsb.mtime.sec
 	else
 		-> srcsb.mtime.nsec < dstsb.mtime.nsec
+	;;
+}
+
+const pmtime = {src, dst
+	var srcsb, dstsb
+
+	if std.stat(src, &srcsb) != 0
+		std.put("\tno %s\n", src)
+	;;
+	if std.stat(dst, &dstsb) != 0
+		std.put("\tno %s\n", dst)
+	;;
+	if srcsb.mtime.sec != dstsb.mtime.sec
+		std.put("\tsrc mtime=%ul, dst mtime=%ul\n", srcsb.mtime.sec, dstsb.mtime.sec)
+	else
+		std.put("\tsrc mtime.nsec=%ul, dst mtime.nsec=%ul\n", srcsb.mtime.nsec, dstsb.mtime.nsec)
 	;;
 }