From 31626da661156c1cbc4cac0ab1effcd15eea0d1f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 20 Sep 2004 13:01:20 +0000 Subject: [PATCH] Exclude .svn files and SVN subdirectories. --- README | 3 ++- comparator.spec | 5 ++++- shredtree.c | 4 ++-- shredtree.py | 6 +++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README b/README index ab6a97c..c151a56 100644 --- 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. diff --git a/comparator.spec b/comparator.spec index 488cd2d..919a0ef 100644 --- a/comparator.spec +++ b/comparator.spec @@ -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 - 2.6-1 +- Ignore .svn files and and SVN subdirectories. Typo fixes on manual page. + * Sat Aug 7 2004 Eric S. Raymond - 2.5-1 - Alan Burlinson's tweaks to ease porting to SunOS. Emil Sit's dramatic speedup for SCF-file reads. Fix incorrect statistics diff --git a/shredtree.c b/shredtree.c index 11c75fe..b0e9402 100644 --- a/shredtree.c +++ b/shredtree.c @@ -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); diff --git a/shredtree.py b/shredtree.py index 9a6ebd5..a8aaaf8 100755 --- a/shredtree.py +++ b/shredtree.py @@ -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 -- 2.43.0