]> thyrsus.com Git - comparator.git/commitdiff
Found some significant merge logic differences.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 2 Sep 2003 03:30:04 +0000 (03:30 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 2 Sep 2003 03:30:04 +0000 (03:30 +0000)
Makefile
report.c

index 58d6702c50e174b40c4486fd61b4af8606e16ae6..b403f67e7a43cb64b199b8a6bbd4c22bf2ad7805 100644 (file)
--- 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
index b17b74599772b3d9d1460c8e0e1853ecacdccbbe..e25e1591008443511f8777fcd8d2ae4e0acb6f90 100644 (file)
--- 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)
        {