dupemerge: merge with waya-zblaxell, fix warning message
authorZygo Blaxell <zblaxell@faye.furryterror.org>
Wed, 6 Jan 2010 18:58:11 +0000 (13:58 -0500)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Sat, 9 Jan 2010 02:22:03 +0000 (21:22 -0500)
Merges up to c92b00c812898fcba6e5ebde14ef83ae597756ee, including
these commits:

6038ff7 dupemerge: have find tell us the device too
fd1d958 dupemerge: maybe improve seek performance by sorting perl hashes
9bf1c63 dupemerge: merge with state-of-the-art on Serenity
a27ea1f dupemerge: update copyright year to 2010
593804d dupemerge: sort incumbent inodes too
1df8571 dupemerge: make inode sort order strictly numeric
24fecbb dupemerge: make sure 'sort -znr' still considers dev/inode numeric
c92b00c dupemerge: inodes are now non-numeric

faster-dupemerge

index 7e77776d59474a93e560d97989d39f2601c9c899..be6e29bc678bd78aec0d92fef00f030e8d829ef3 100755 (executable)
@@ -291,6 +291,7 @@ sub link_files {
 # Convert $dev,$ino into a single string where lexical and numeric orderings are equivalent
 sub format_inode ($$) {
        my ($dev, $ino) = @_;
 # Convert $dev,$ino into a single string where lexical and numeric orderings are equivalent
 sub format_inode ($$) {
        my ($dev, $ino) = @_;
+       # 64 bits ought to be enough for everybody!
        return sprintf('%016x:%016x', $dev, $ino);
 }
 
        return sprintf('%016x:%016x', $dev, $ino);
 }
 
@@ -367,7 +368,7 @@ incumbent_file:
                                                }
 
                                                if (format_inode($incumbent_dev, $incumbent_ino) ne $incumbent) {
                                                }
 
                                                if (format_inode($incumbent_dev, $incumbent_ino) ne $incumbent) {
-                                                       warn "$incumbent_file: expected inode $incumbent, found $incumbent_ino";
+                                                       warn "$incumbent_file: expected inode $incumbent, found $incumbent_dev:$incumbent_ino";
                                                        $surprises++;
                                                        next incumbent_file;
                                                }
                                                        $surprises++;
                                                        next incumbent_file;
                                                }
@@ -387,7 +388,7 @@ candidate_file:
                                                        }
 
                                                        if (format_inode($candidate_dev, $candidate_ino) ne $candidate) {
                                                        }
 
                                                        if (format_inode($candidate_dev, $candidate_ino) ne $candidate) {
-                                                               warn "$candidate_file: expected inode $candidate, found $candidate_ino";
+                                                               warn "$candidate_file: expected inode $candidate, found $candidate_dev:$candidate_ino";
                                                                $surprises++;
                                                                next candidate_file;
                                                        }
                                                                $surprises++;
                                                                next candidate_file;
                                                        }
@@ -552,7 +553,6 @@ while (<FIND>) {
        my ($weak_key, $dev, $ino, $name) = m/^(\d+ \d+ \d+ \d+ -?[\d.]+) (\d+) (\d+) (.+)\0$/so;
        die "read error: $!\nLast input line was '$_'" unless defined($name);
 
        my ($weak_key, $dev, $ino, $name) = m/^(\d+ \d+ \d+ \d+ -?[\d.]+) (\d+) (\d+) (.+)\0$/so;
        die "read error: $!\nLast input line was '$_'" unless defined($name);
 
-       # 64 bits out to be enough for everybody!
        my $inode = format_inode($dev, $ino);
 
        print STDERR "weak_key=$weak_key inode=$inode name=$name\n" if $debug;
        my $inode = format_inode($dev, $ino);
 
        print STDERR "weak_key=$weak_key inode=$inode name=$name\n" if $debug;