]> thyrsus.com Git - comparator.git/commitdiff
Exclude .svn files and SVN subdirectories.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 20 Sep 2004 13:01:20 +0000 (13:01 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 20 Sep 2004 13:01:20 +0000 (13:01 +0000)
README
comparator.spec
shredtree.c
shredtree.py

diff --git a/README b/README
index ab6a97ce69ea6f2ea7441407a7cc2392d27aff9a..c151a56ed8d5def2304c0891c8d935f003534e07 100644 (file)
--- a/README
+++ b/README
@@ -7,7 +7,8 @@ with a filtering postprecessor, filterator.
 Besides the production C code, the distribution also includes 
 working Python versions.  These were used to prototype the concept.
 
-If yiou want to write a new normalizer, see normalizer.c
+If you want to write a new normalizer, see linebyline.c for an example
+of how it's done.
 
 The document scf-standard.xml describes file interchange formata
 for programs that wish to interoperate with comparator.
index 488cd2d703eba9fc714f0ade3cc39dcf3c6da822..919a0efb7b5b6d988840d83d7e4130015646355e 100644 (file)
@@ -1,6 +1,6 @@
 Name: comparator
 Summary: fast comparison of large source-code trees
-Version: 2.5
+Version: 2.6
 Release: 1
 License: GPL
 Group: Utilities
@@ -44,6 +44,9 @@ cp comparator.py "$RPM_BUILD_ROOT"${pylib}
 %{_libdir}/python*/site-packages/comparator.py
 
 %changelog
+* Mon Sep 20 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.6-1
+- Ignore .svn files and and SVN subdirectories.  Typo fixes on manual page.
+
 * Sat Aug  7 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.5-1
 - Alan Burlinson's tweaks to ease porting to SunOS. Emil Sit's 
   dramatic speedup for SCF-file reads.  Fix incorrect statistics
index 11c75fed619cd877be3ae2c65d5f44138f294be8..b0e940219e7dcf0a557e0b07f71755ef29faf361 100644 (file)
@@ -42,7 +42,7 @@ static int file_count;
 static int eligible(const char *file)
 /* is the specified file eligible to be compared? */ 
 {
-    if (strstr(file, "CVS") || strstr(file,"RCS") || strstr(file,"SCCS") || strstr(file, ".svn"))
+    if (strstr(file, "CVS") || strstr(file,"RCS") || strstr(file,"SCCS") || strstr(file, "SVN") || strstr(file, ".svn"))
        return(0);
     /* fast check for the most common suffixes */
 #define endswith(suff) !strcmp(suff, file + strlen(file) - strlen(suff))
@@ -130,7 +130,7 @@ int shredfile(struct filehdr_t *file,
     /* deduce what filtering type we should use */
 #define endswith(suff) !strcmp(suff,file->name+strlen(file->name)-strlen(suff))
     linebyline.mode(0);
-    if (endswith(".c") || endswith(".h"))
+    if (endswith(".c") || endswith(".cc") || endswith(".h"))
        linebyline.mode(C_CODE);
     else if (endswith(".sh"))
        linebyline.mode(SHELL_CODE);
index 9a6ebd5bcdbdfda7742188702fb2c19e819f4ab9..a8aaaf889c10ab24460a1b57f189c3fbb03e41bc 100755 (executable)
@@ -12,8 +12,12 @@ def eligible(file):
      st_atime, st_mtime, st_ctime) = os.stat(file)
     if st_size <= 0:
         return False
+    elif filter(lambda x: file.endswith(x), ('.o','~', '.bdf')):
+        return False
+    elif filter(lambda x: file.find(x)>-1, ('RCS','SCCS','CVS','SVN','.svn')):
+        return False
     elif c_only:
-        return filter(lambda x: file.endswith(x), ('.c','h','.txt'))
+        return filter(lambda x: file.endswith(x), ('.c','.cc','.h','.html'))
     else:
         return True