# HG changeset patch # User Pascal Bellard # Date 1558602597 -7200 # Node ID e2ff6056f93a5679f115da8b88e1bfde3948e165 # Parent 7c8e4ca195113b846be23387a488b5ad55e66791 Fix deduplicate symlinks diff -r 7c8e4ca19511 -r e2ff6056f93a tazlito --- a/tazlito Tue Feb 26 08:21:00 2019 +0100 +++ b/tazlito Thu May 23 11:09:57 2019 +0200 @@ -868,11 +868,14 @@ _ '%s Kbytes saved in %s duplicate files.' "$save" "$hardlinks" ) - find "$@" -xdev -type l -exec stat -c '%s-%u-%g-TARGET- %i %h %n' {} \; | sort | \ + find "$@" -xdev -type l -exec stat -c '%s-%u-%g %i %h %n' {} \; | \ + while read attr inode link file; do + echo "$attr-$(readlink "$file" | uuencode -m - | \ + sed '1d;:b;{N;s/\n//;bb;}') $inode $link $file" + done | sort | \ ( old_attr=""; hardlinks=0; while read attr inode link file; do - attr="${attr/-TARGET-/-$(readlink $file)}" if [ "$attr" = "$old_attr" ]; then if [ "$inode" != "$old_inode" ]; then rm -f "$file"