aboutsummaryrefslogtreecommitdiffstats
path: root/meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'meta.c')
-rw-r--r--meta.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/meta.c b/meta.c
index 3aec19a78907..e7c7597a3af3 100644
--- a/meta.c
+++ b/meta.c
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.30 2013/05/16 21:56:56 sjg Exp $ */
+/* $NetBSD: meta.c,v 1.32 2013/06/25 00:20:54 sjg Exp $ */
/*
* Implement 'meta' mode.
@@ -55,7 +55,12 @@
#endif
static BuildMon Mybm; /* for compat */
-static Lst metaBailiwick; /* our scope of control */
+static Lst metaBailiwick; /* our scope of control */
+static Lst metaIgnorePaths; /* paths we deliberately ignore */
+
+#ifndef MAKE_META_IGNORE_PATHS
+#define MAKE_META_IGNORE_PATHS ".MAKE.META.IGNORE_PATHS"
+#endif
Boolean useMeta = FALSE;
static Boolean useFilemon = FALSE;
@@ -607,6 +612,17 @@ meta_mode_init(const char *make_mode)
if (cp) {
str2Lst_Append(metaBailiwick, cp, NULL);
}
+ /*
+ * We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS}
+ */
+ metaIgnorePaths = Lst_Init(FALSE);
+ Var_Append(MAKE_META_IGNORE_PATHS,
+ "/dev /etc /proc /tmp /var/run /var/tmp ${TMPDIR}", VAR_GLOBAL);
+ cp = Var_Subst(NULL,
+ "${" MAKE_META_IGNORE_PATHS ":O:u:tA}", VAR_GLOBAL, 0);
+ if (cp) {
+ str2Lst_Append(metaIgnorePaths, cp, NULL);
+ }
}
/*
@@ -1110,20 +1126,15 @@ meta_oodate(GNode *gn, Boolean oodate)
* be part of the dependencies because
* they are _expected_ to change.
*/
- if (strncmp(p, "/tmp/", 5) == 0 ||
- (tmplen > 0 && strncmp(p, tmpdir, tmplen) == 0))
- break;
-
- if (strncmp(p, "/var/", 5) == 0)
- break;
-
- /* Ignore device files. */
- if (strncmp(p, "/dev/", 5) == 0)
- break;
-
- /* Ignore /etc/ files. */
- if (strncmp(p, "/etc/", 5) == 0)
+ if (*p == '/' &&
+ Lst_ForEach(metaIgnorePaths, prefix_match, p)) {
+#ifdef DEBUG_META_MODE
+ if (DEBUG(META))
+ fprintf(debug_file, "meta_oodate: ignoring: %s\n",
+ p);
+#endif
break;
+ }
if ((cp = strrchr(p, '/'))) {
cp++;