From: Zygo Blaxell Date: Wed, 6 Jan 2010 16:07:24 +0000 (-0500) Subject: dupemerge: have find tell us the device too X-Git-Tag: dm6-0.20100514~31^2~1 X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=dupemerge;a=commitdiff_plain;h=2f607d26931ff8ed86b7f41d19f62679f8ac916d dupemerge: have find tell us the device too faster-dupemerge cannot be used to link files on multiple filesystems because the hardlinks will fail; however, if this is attempted anyway then files with identical weak keys (size+timestamp+permissions) and identical inode numbers might be considered as identical for hashing and comparing purposes when they are not. That would be bad. --- diff --git a/faster-dupemerge b/faster-dupemerge index 82483a2..6371fd0 100755 --- a/faster-dupemerge +++ b/faster-dupemerge @@ -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@ ') . - '%i %p\0'; + '%D:%i %p\0'; push(@find_command, '!', '-empty') unless $collapse_zero; push(@find_command, '-printf', $printf_string); @@ -538,7 +538,7 @@ end_merge: } while () { - my ($weak_key, $inode, $name) = m/^(\d+ \d+ \d+ \d+ -?\d+) (\d+) (.+)\0$/so; + my ($weak_key, $inode, $name) = m/^(\d+ \d+ \d+ \d+ -?\d+) (\d+:\d+) (.+)\0$/so; die "read error: $!\nLast input line was '$_'" unless defined($name); print STDERR "weak_key=$weak_key inode=$inode name=$name\n" if $debug;