#647630 fdupes: Merge n groups of hardlinked files to a single hardlinked file

Package:
fdupes
Source:
fdupes
Description:
identifies duplicate files within given directories
Submitter:
Warp Zero
Date:
2015-12-20 14:18:17 UTC
Severity:
wishlist
#647630#5
Date:
2011-11-04 17:03:59 UTC
From:
To:
Dear Maintainer,
   * What led up to the situation?
        Wanted to do: fdupes -H -L
   * What was the outcome of this action?
        fdupes: options --linkhard and --hardlinks are not compatible
   * What outcome did you expect instead?
        Does what I asked of it.

The only way to achieve the desired result is to run fdupes --linkhard
multiple times (until it stops merging hardlinked groups of files)

This is impractical for large directories.

For example: if I run
mkdir -p test/a test/b
echo "blah" >test/a/a
echo "blah" >test/b/a
ln test/a/a test/a/b
ln test/b/a test/b/b
# now a/a and a/b share 1 inode and b/a, b/b share one inode
fdupes -r -L test
# now a/a a/b and b/b share 1 inode but b/a is all by itself
fdupes -r -L test
# now they all share 1 inode, the desired result

#647630#12
Date:
2011-11-19 19:32:51 UTC
From:
To:
The documentation says that the -H and -L options conflict, however, not
only do they not appear to conflict, but

fdupes -L -H dirs...

is exactly what I want to do to deduplicate certain collections of files.

Removing the following check from

debian/patches/50_bts284274_hardlinkreplace.dpatch

seems to result in the desired behaviour.
--- 50_bts284274_hardlinkreplace.dpatch 2011-11-19 14:23:28.000000000 -0500 +++ 50_bts284274_hardlinkreplace.dpatch.new 2011-11-19 14:30:54.000000000 -0500 @@ -189,11 +189,6 @@ + exit(1); + } + -+ if (ISFLAG(flags, F_HARDLINKFILES) && ISFLAG(flags, F_CONSIDERHARDLINKS)) { -+ errormsg("options --linkhard and --hardlinks are not compatible\n"); -+ exit(1); -+ } -+ if (ISFLAG(flags, F_RECURSEAFTER)) { firstrecurse = nonoptafter("--recurse:", argc, oldargv, argv, optind); Yours Joseph Maher