projects
/
dupemerge
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dupemerge: make sure 'sort -znr' still considers dev/inode numeric
[dupemerge]
/
faster-dupemerge
diff --git
a/faster-dupemerge
b/faster-dupemerge
index d35f591a442a9c7bb6c52ea160bed284825089b0..4ad0176ea3dfcddddc95fa685aa8c2c9ef63d0f6 100755
(executable)
--- a/
faster-dupemerge
+++ b/
faster-dupemerge
@@
-4,7
+4,7
@@
use Fcntl qw(:DEFAULT :flock);
use File::Compare;
use File::Temp;
use File::Compare;
use File::Temp;
-# Copyright (C) 2003-20
09
Zygo Blaxell <faster-dupemerge@mailtoo.hungrycats.org>
+# Copyright (C) 2003-20
10
Zygo Blaxell <faster-dupemerge@mailtoo.hungrycats.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-238,7
+238,7
@@
my @find_command = ('find', @directories, @extra_find_opts, '-type', 'f');
my $printf_string = '%s ' .
($collapse_access ? '0 0 0 ' : '%U %G %m ') .
($collapse_timestamp ? '0 ' : '%T@ ') .
my $printf_string = '%s ' .
($collapse_access ? '0 0 0 ' : '%U %G %m ') .
($collapse_timestamp ? '0 ' : '%T@ ') .
- '%D
:
%i %p\0';
+ '%D
%i %p\0';
push(@find_command, '!', '-empty') unless $collapse_zero;
push(@find_command, '-printf', $printf_string);
push(@find_command, '!', '-empty') unless $collapse_zero;
push(@find_command, '-printf', $printf_string);
@@
-335,7
+335,7
@@
hash_file:
my $incumbent_list = ($hash_to_inode{$digest} ||= []);
my $incumbent_matched = 0;
my $incumbent_list = ($hash_to_inode{$digest} ||= []);
my $incumbent_matched = 0;
- for my $incumbent (@$incumbent_list) {
+ for my $incumbent (
sort
@$incumbent_list) {
print STDERR "\t\tInodes $incumbent and $candidate have same hash\n" if $debug;
my $finished = 0;
print STDERR "\t\tInodes $incumbent and $candidate have same hash\n" if $debug;
my $finished = 0;
@@
-543,9
+543,12
@@
end_merge:
}
while (<FIND>) {
}
while (<FIND>) {
- my ($weak_key, $
inode, $name) = m/^(\d+ \d+ \d+ \d+ -?[\d.]+) (\d+:
\d+) (.+)\0$/so;
+ 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);
die "read error: $!\nLast input line was '$_'" unless defined($name);
+ # 64 bits out to be enough for everybody!
+ my $inode = sprintf('%016x:%016x', $dev, $ino);
+
print STDERR "weak_key=$weak_key inode=$inode name=$name\n" if $debug;
unless (! (-l $name) && (-f _)) {
print STDERR "weak_key=$weak_key inode=$inode name=$name\n" if $debug;
unless (! (-l $name) && (-f _)) {