Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Add .MAKE.META.IGNORE_PATHS to facilitate local...
details: https://anonhg.NetBSD.org/src/rev/14a2cd022fd0
branches: trunk
changeset: 787580:14a2cd022fd0
user: sjg <sjg%NetBSD.org@localhost>
date: Tue Jun 25 00:20:54 2013 +0000
description:
Add .MAKE.META.IGNORE_PATHS to facilitate local additions to the paths
which should be ignored by meta_oodate().
diffstat:
usr.bin/make/make.1 | 9 +++++++--
usr.bin/make/meta.c | 45 ++++++++++++++++++++++++++-------------------
2 files changed, 33 insertions(+), 21 deletions(-)
diffs (104 lines):
diff -r 566eaf855ade -r 14a2cd022fd0 usr.bin/make/make.1
--- a/usr.bin/make/make.1 Mon Jun 24 21:16:02 2013 +0000
+++ b/usr.bin/make/make.1 Tue Jun 25 00:20:54 2013 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.215 2013/05/22 19:35:11 christos Exp $
+.\" $NetBSD: make.1,v 1.216 2013/06/25 00:20:54 sjg Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
-.Dd May 22, 2013
+.Dd June 24, 2013
.Dt MAKE 1
.Os
.Sh NAME
@@ -856,6 +856,11 @@
used (updated or not).
This list can be used to process the meta files to extract dependency
information.
+.It Va .MAKE.META.IGNORE_PATHS
+Provides a list of path prefixes that should be ignored;
+because the contents are expected to change over time.
+The default list includes:
+.Ql Pa /dev /etc /proc /tmp /var/run /var/tmp
.It Va .MAKE.META.PREFIX
Defines the message printed for each meta file updated in "meta verbose" mode.
The default value is:
diff -r 566eaf855ade -r 14a2cd022fd0 usr.bin/make/meta.c
--- a/usr.bin/make/meta.c Mon Jun 24 21:16:02 2013 +0000
+++ b/usr.bin/make/meta.c Tue Jun 25 00:20:54 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.31 2013/06/24 21:16:02 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 @@
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,24 +1126,15 @@
* 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)
+ 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;
-
- /* Ignore device files. */
- if (strncmp(p, "/dev/", 5) == 0)
- break;
-
- /* Ignore /etc/ files. */
- if (strncmp(p, "/etc/", 5) == 0)
- break;
-
- /* Ignore /proc/ too. */
- if (strncmp(p, "/proc/", 6) == 0)
- break;
+ }
if ((cp = strrchr(p, '/'))) {
cp++;
Home |
Main Index |
Thread Index |
Old Index