Module Name:    src
Committed By:   sjg
Date:           Sat Jun  4 22:17:14 UTC 2016

Modified Files:
        src/usr.bin/make: meta.c

Log Message:
meta_oodate even when missing-meta is true, we do not make a target in
.CURDIR out of date just because of a missing meta file.

Also we can only be missing filemon data if we had a meta file.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/make/meta.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.59 src/usr.bin/make/meta.c:1.60
--- src/usr.bin/make/meta.c:1.59	Fri Jun  3 01:21:59 2016
+++ src/usr.bin/make/meta.c	Sat Jun  4 22:17:14 2016
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.59 2016/06/03 01:21:59 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.60 2016/06/04 22:17:14 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1451,18 +1451,27 @@ meta_oodate(GNode *gn, Boolean oodate)
 			fname, (char *)Lst_Datum(Lst_First(missingFiles)));
 	    oodate = TRUE;
 	}
-    } else {
-	if (writeMeta && metaMissing) {
+	if (!oodate && !have_filemon && filemonMissing) {
 	    if (DEBUG(META))
-		fprintf(debug_file, "%s: required but missing\n", fname);
+		fprintf(debug_file, "%s: missing filemon data\n", fname);
 	    oodate = TRUE;
 	}
-    }
+    } else {
+	if (writeMeta && metaMissing) {
+	    cp = NULL;
 
-    if (!oodate && !have_filemon && filemonMissing) {
-	if (DEBUG(META))
-	    fprintf(debug_file, "%s: missing filemon data\n", fname);
-	oodate = TRUE;
+	    /* if target is in .CURDIR we do not need a meta file */
+	    if (gn->path && (cp = strrchr(gn->path, '/')) && cp > gn->path) {
+		if (strncmp(curdir, gn->path, (cp - gn->path)) != 0) {
+		    cp = NULL;		/* not in .CURDIR */
+		}
+	    }
+	    if (!cp) {
+		if (DEBUG(META))
+		    fprintf(debug_file, "%s: required but missing\n", fname);
+		oodate = TRUE;
+	    }
+	}
     }
 
     Lst_Destroy(missingFiles, (FreeProc *)free);

Reply via email to