]> thyrsus.com Git - comparator.git/commitdiff
Fully implemented -v.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 22:15:51 +0000 (22:15 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 22:15:51 +0000 (22:15 +0000)
Makefile
report.c
shred.h

index 028588c2087ea1d6fba45552cdcacff46b5ddda9..b742f4f47df7356359f7a71cd96f077fa571db95 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -63,6 +63,19 @@ regress:
            fi; \
        done
 
+# Test that making several hash files at one go doesn't mess up. 
+UNIX = /home/esr/src/unix
+SRC1  = net2
+SRC2  = src5r4
+regress2:
+       comparator -C -c -d $(UNIX) $(SRC1) >test1-old.dump
+       comparator -C -c -d $(UNIX) $(SRC2) >test2-old.dump
+       comparator -C -c -d $(UNIX):$(UNIX) $(SRC1) $(SRC2)
+       dumpscf <$(SRC1).scf >$test1.dump
+       dumpscf <$(SRC2).scf >$test2.dump
+       diff -u test1-old.dump test1.dump
+       diff -u test2-old.dump test2.dump
+
 install: comparator.1 uninstall
        install -m 755 -o 0 -g 0 -d $(ROOT)/usr/bin/
        install -m 755 -o 0 -g 0 comparator $(ROOT)/usr/bin/comparator
index 70172a7b5c70b7ddb1db46f4461610f123f48260..b102df2c3e5c3dc646251bb47ce741ad17652c1c 100644 (file)
--- a/report.c
+++ b/report.c
@@ -252,14 +252,15 @@ struct match_t *reduce_matches(struct sorthash_t *obarray, int *hashcountp)
 
      /* build list of hashes with more than one range associated */
      nonuniques = progress = 0;
-     fprintf(stderr, "%% Extracting duplicates...   ");
+     if (verbose)
+        fprintf(stderr, "%% Extracting duplicates...   ");
      nreduced = 10000;
      reduced = (struct match_t *)malloc(sizeof(struct match_t) * nreduced);
      for (np = obarray; np < obarray + hashcount; np = mp)
      {
         int i, heterogenous, nmatches;
 
-        if (!debug && progress++ % 10000 == 0)
+        if (verbose && !debug && progress++ % 10000 == 0)
             fprintf(stderr, "\b\b\b%02.0f%%", progress / (hashcount * 0.01));
 
         /* count the number of hash matches */
@@ -303,7 +304,8 @@ struct match_t *reduce_matches(struct sorthash_t *obarray, int *hashcountp)
         reduced[nonuniques].nmatches = nmatches;
         nonuniques++;
      }
-     fprintf(stderr, "\b\b\b100%% done.\n");
+     if (verbose)
+        fprintf(stderr, "\b\b\b100%% done.\n");
 
      *hashcountp = nonuniques;
      return reduced;
diff --git a/shred.h b/shred.h
index da3ea87642c42699975c91214069ac46fa52aa1c..4aa30435622cf5da31c335c378f3d3c6b683d5d9 100644 (file)
--- a/shred.h
+++ b/shred.h
@@ -48,7 +48,7 @@ struct sorthash_t
 extern int remove_braces;
 extern int remove_whitespace;
 extern int remove_comments;
-extern int debug;
+extern int verbose, debug;
 extern int shredsize;
 
 /* main.c functions */