From: Eric S. Raymond Date: Sun, 14 Sep 2003 22:15:51 +0000 (+0000) Subject: Fully implemented -v. X-Git-Tag: 1.6~16 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=eccdcaf12051559d3b7ac6f0a2afef3524a29333;p=comparator.git Fully implemented -v. --- diff --git a/Makefile b/Makefile index 028588c..b742f4f 100644 --- 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 diff --git a/report.c b/report.c index 70172a7..b102df2 100644 --- 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 da3ea87..4aa3043 100644 --- 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 */