Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jun 2008 00:33:08 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 142994 for review
Message-ID:  <200806060033.m560X88X007773@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=142994

Change 142994 by peter@peter_overcee on 2008/06/06 00:32:58

	Bah.  I needed to grep within the .svn directories.
	Add --exclude-junk for the benefit of alias.

Affected files ...

.. //depot/projects/hammer/gnu/usr.bin/grep/grep.c#9 edit
.. //depot/projects/hammer/gnu/usr.bin/grep/grep.h#4 edit
.. //depot/projects/hammer/gnu/usr.bin/grep/savedir.c#5 edit

Differences ...

==== //depot/projects/hammer/gnu/usr.bin/grep/grep.c#9 (text+ko) ====

@@ -102,6 +102,7 @@
   INCLUDE_OPTION,
   EXCLUDE_OPTION,
   EXCLUDE_FROM_OPTION,
+  EXCLUDE_JUNK_OPTION,
   LINE_BUFFERED_OPTION,
   LABEL_OPTION
 };
@@ -123,6 +124,7 @@
   {"extended-regexp", no_argument, NULL, 'E'},
   {"exclude", required_argument, NULL, EXCLUDE_OPTION},
   {"exclude-from", required_argument, NULL, EXCLUDE_FROM_OPTION},
+  {"exclude-junk", no_argument, NULL, EXCLUDE_JUNK_OPTION},
   {"file", required_argument, NULL, 'f'},
   {"files-with-matches", no_argument, NULL, 'l'},
   {"files-without-match", no_argument, NULL, 'L'},
@@ -169,6 +171,7 @@
 int match_words;
 int match_lines;
 unsigned char eolbyte;
+int exclude_junk;
 
 /* For error messages. */
 /* The name the program was run with, stripped of any leading path. */
@@ -1709,6 +1712,10 @@
 	label = optarg;
 	break;
 
+      case EXCLUDE_JUNK_OPTION:
+	exclude_junk = 1;
+	break;
+
       case 0:
 	/* long options */
 	break;

==== //depot/projects/hammer/gnu/usr.bin/grep/grep.h#4 (text+ko) ====

@@ -42,3 +42,4 @@
 extern int match_words;		/* -w */
 extern int match_lines;		/* -x */
 extern unsigned char eolbyte;	/* -z */
+extern int exclude_junk;	/* --exclude-junk */

==== //depot/projects/hammer/gnu/usr.bin/grep/savedir.c#5 (text+ko) ====

@@ -68,6 +68,7 @@
 
 #include <fnmatch.h>
 #include "savedir.h"
+#include "grep.h"
 
 char *path;
 size_t pathlen;
@@ -134,7 +135,8 @@
 	  off_t size_needed = (namep - name_space) + NAMLEN (dp) + 2;
 
 	  /* Exclude SCM control files and other known junk */
-	  if ((strcmp(dp->d_name, ".svn") == 0 ||
+	  if (exclude_junk &&
+	      (strcmp(dp->d_name, ".svn") == 0 ||
 	       strcmp(dp->d_name, "CVS") == 0 ||
 	       strcmp(dp->d_name, "RCS") == 0 ||
 	       strcmp(dp->d_name, "obj") == 0 ||



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806060033.m560X88X007773>