svn commit: r261493 - head/usr.sbin/config

Warner Losh imp at FreeBSD.org
Tue Feb 4 18:28:59 UTC 2014


Author: imp
Date: Tue Feb  4 18:28:58 2014
New Revision: 261493
URL: http://svnweb.freebsd.org/changeset/base/261493

Log:
  Implement the '!' operator for files* files. It means 'include this
  only if the specified option is NOT specified.' Bump version because
  old config won't be able to cope with files* files that have this
  construct in them.

Modified:
  head/usr.sbin/config/configvers.h
  head/usr.sbin/config/mkmakefile.c

Modified: head/usr.sbin/config/configvers.h
==============================================================================
--- head/usr.sbin/config/configvers.h	Tue Feb  4 18:24:25 2014	(r261492)
+++ head/usr.sbin/config/configvers.h	Tue Feb  4 18:28:58 2014	(r261493)
@@ -49,5 +49,5 @@
  *
  * $FreeBSD$
  */
-#define	CONFIGVERS	600012
+#define	CONFIGVERS	600013
 #define	MAJOR_VERS(x)	((x) / 100000)

Modified: head/usr.sbin/config/mkmakefile.c
==============================================================================
--- head/usr.sbin/config/mkmakefile.c	Tue Feb  4 18:24:25 2014	(r261492)
+++ head/usr.sbin/config/mkmakefile.c	Tue Feb  4 18:28:58 2014	(r261493)
@@ -308,7 +308,7 @@ read_file(char *fname)
 	struct opt *op;
 	char *wd, *this, *compilewith, *depends, *clean, *warning;
 	const char *objprefix;
-	int compile, match, nreqs, std, filetype,
+	int compile, match, nreqs, std, filetype, not,
 	    imp_rule, no_obj, before_depend, nowerror;
 
 	fp = fopen(fname, "r");
@@ -366,6 +366,7 @@ next:
 	no_obj = 0;
 	before_depend = 0;
 	nowerror = 0;
+	not = 0;
 	filetype = NORMAL;
 	objprefix = "";
 	if (eq(wd, "standard"))
@@ -376,13 +377,21 @@ next:
 	for (wd = get_word(fp); wd; wd = get_word(fp)) {
 		if (wd == (char *)EOF)
 			return;
+		if (eq(wd, "!")) {
+			not = 1;
+			continue;
+		}
 		if (eq(wd, "|")) {
 			if (nreqs == 0)
 				errout("%s: syntax error describing %s\n",
 				       fname, this);
-			compile += match;
+			if (not)
+				compile += !match;
+			else
+				compile += match;
 			match = 1;
 			nreqs = 0;
+			not = 0;
 			continue;
 		}
 		if (eq(wd, "no-obj")) {
@@ -471,9 +480,13 @@ next:
 			if (op->op_value == 0 && opteq(op->op_name, wd))
 				goto nextparam;
 		match = 0;
-nextparam:;
+nextparam:
+		not = 0;
 	}
-	compile += match;
+	if (not)
+		compile += !match;
+	else
+		compile += match;
 	if (compile && tp == NULL) {
 		if (std == 0 && nreqs == 0)
 			errout("%s: what is %s optional on?\n",


More information about the svn-src-all mailing list