On Thu, 2021-03-18 at 00:12 -0700, L A Walsh wrote:
I noticed in 1 rpm, there was a comment next to an %fdupes line -- which I guess is a macro(?) saying:
# Hardlink duplicate files %fdupes ${RPM_BUILD_ROOT}
Is it still used for purposes of hardlinking dupes?
If so, how does that work? when I looked at fdupes, I didn't see an option to hardlink dups, only options to delete dups.
Anyway, would it be useful if that was about 40% faster?
You can check out what the macro expands to using:
rpm -E "%fdupes /usr/foo"
_target=""; _symlinks=0; fdupes -q -p -n -H -o name -r /usr/foo | while read _file; do if test -z "$_target" ; then _target="$_file"; else if test -z "$_file" ; then _target=""; continue ; fi ; if test "$_symlinks" = 1; then ln -sf "${_target#/home/abuild/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64}" "$_file"; else ln -f "$_target" "$_file"; fi ; fi ; done $_symlinks is set to 1 when using fdupes -s Cheers, Dominique