From 7e4ede70a3eb2b053232ab00998fb8243a6e9849 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 2 Sep 2003 03:30:04 +0000 Subject: [PATCH] Found some significant merge logic differences. --- Makefile | 11 ++++++++--- report.c | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 58d6702..b403f67 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,11 @@ clean: rm -f shredtree shredcompare shredtree.o md5.o shredcompare.o test: - time shredtree -c -w -d ~/src/unix src5r4 >src5r4.shif - time shredtree -c -w -d ~/src/unix linux-2.6.0-test4 >linux-2.6.0-test4.shif - time shredcompare.py src5r4.shif linux-2.6.0-test4.shif >TEST.LOG + shredtree -c test1 >TEST1 + shredtree -c test2 >TEST2 + shredcompare TEST1 TEST2 + +testgood: + shredtree -c test3 >TEST1 + shredtree -c test4 >TEST2 + shredcompare TEST1 TEST2 diff --git a/report.c b/report.c index b17b745..e25e159 100644 --- a/report.c +++ b/report.c @@ -31,6 +31,7 @@ struct shif_t char *hash_method; char *generator_program; }; +static struct shif_t *shiflist; struct sorthash_t { @@ -112,7 +113,7 @@ void init_intern(const int count) static void merge_hashes(int argc, char *argv[]) /* merge hashes from specified files into an in-code list */ { - struct shif_t *shiflist, *sp; + struct shif_t *sp; struct stat sb; long total; @@ -140,6 +141,8 @@ void init_intern(const int count) break; value = strchr(buf, ':'); *value++ = '\0'; + while(*value == ' ') + value++; strchr(value, '\n')[0] = '\0'; if (!strcmp(buf, "Normalization")) @@ -313,7 +316,7 @@ struct match_t *reduce_matches(int localdups) /* if all these matches are within the same tree, toss them */ heterogenous = 0; for (i = 0; i < nmatches; i++) - if (sametree(mp[i].file,mp[(i+1) % nmatches].file)) + if (sametree(np[i].file, np[(i+1) % nmatches].file)) heterogenous++; if (!heterogenous) continue; @@ -453,6 +456,13 @@ main(int argc, char *argv[]) hitlist = reduce_matches(local_duplicates); report_time("Reduction done"); + puts("#SHIF-B 1.0"); + puts("Merge-Program: shredcompare 1.0"); + printf("Shred-Size: %d\n", shiflist[0].shred_size); + printf("Hash-Method: %s\n", shiflist[0].hash_method); + printf("Normalization: %s\n", shiflist[0].normalization); + puts("%%"); + for (; hitlist->next; hitlist = hitlist->next) if (hitlist->matches) { -- 2.43.0