This updated version of the jdupes duplicate file finder port to BusyBox
adds a whole host of feature exclusions that allow further reduction of
the applet's size. Nearly all of the final actions performed by jdupes
(deletion, linking, etc.) can be done by piping the output to a shell
script anyway, though it's not as convenient or quick as having the
program do it for you. All final actions other than printing match sets
can now be disabled, and all of the progress bar code can now be tossed
out as well.
With the new exclusions available, a BusyBox defconfig with a fully
stripped down jdupes weighs in just barely under 10K:
$ size busybox_with*
text data bss dec hex filename
1009790 6763 3648 1020201 f9129 busybox_with_jdupes
1000754 6747 3512 1011013 f6d45 busybox_with_jdupes_minimal
991308 6731 3216 1001255 f4727 busybox_without_jdupes
Modified time support being disabled will reduce the size of the heavily
used per-file struct by a time_t and throws out time checks in a some
"hot" code paths, speeding things up a bit more. The clear downside is
that this opens the gates wide for TOCTTOU errors if chosen and I've
noted that in the help text.
/* jdupes (C) 2015-2018 Jody Bruchon
Derived from fdupes (C) 1999-2018 Adrian Lopez
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
//config:config JDUPES
//config: bool "jdupes (18.9 kb)"
//config: default y
//config: help
//config: A powerful duplicate file finder and manager
//config:
//config:config FEATURE_JDUPES_BTRFS
//config: bool "btrfs dedupe support"
//config: select PLATFORM_LINUX
//config: default y
//config: depends on JDUPES
//config: help
//config: Support btrfs/XFS block-level deduplication in jdupes
//config:
//config:config FEATURE_JDUPES_USER_ORDER
//config: bool "Parameter order operations"
//config: default y
//config: depends on JDUPES
//config: help
//config: Enable jdupes options that use parameter order (-I, -O)
//config:
//config:config FEATURE_JDUPES_HARDLINKS
//config: bool "Hard link support"
//config: default y
//config: depends on JDUPES
//config: help
//config: Support hard link checking and creation in jdupes
//config:
//config:config FEATURE_JDUPES_SYMLINKS
//config: bool "Symbolic link support"
//config: default y
//config: depends on JDUPES
//config: help
//config: Support symbolic link checking and creation in jdupes
//config:
//config:config FEATURE_JDUPES_PERMS
//config: bool "Permission no-match support (-p)"
//config: default y
//config: depends on JDUPES
//config: help
//config: Enable no-match if file user/group different
//config:
//config:config FEATURE_JDUPES_SUMMARIZE
//config: bool "Summarized output support (-m/-M)"
//config: default y
//config: depends on JDUPES
//config: help
//config: jdupes options to output a summary of matched file information
//config:
//config:config FEATURE_JDUPES_DELETE
//config: bool "File deletion support (-d)"
//config: default y
//config: depends on JDUPES
//config: help
//config: jdupes option for deleting files after processing
//config:
//config:config FEATURE_JDUPES_EXCLUDE
//config: bool "File exclusion support (-X)"
//config: default y
//config: depends on JDUPES
//config: help
//config: jdupes option for excluding files from match checking
//config:
//config:config FEATURE_JDUPES_SOFTABORT
//config: bool "Process partials on abort support (-Z)"
//config: default y
//config: depends on JDUPES
//config: help
//config: Support jdupes receiving a signal such as CTRL+C and
//config: processing files matched up to that point instead of
//config: immediately terminating and losing all progress.
//config: