From 220f6d676e528f09540235e7cb17d55b5d86d615 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Thu, 9 Mar 2023 23:09:29 +0400 Subject: [PATCH] sh: use `cp -a --attributes-only` instead of `touch -mr` --- lib/formats/sh.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/formats/sh.sh b/lib/formats/sh.sh index a8405350..893588c4 100644 --- a/lib/formats/sh.sh +++ b/lib/formats/sh.sh @@ -238,12 +238,12 @@ cp_reflink() { if [ -z "$STAMPFILE2" ]; then STAMPFILE2=$(mktemp "${TMPDIR:-/tmp}/rmlint.XXXXXXXX.stamp") fi - touch -mr "$1" -- "$STAMPFILE2" + cp --archive --attributes-only --no-target-directory -- "$1" "$STAMPFILE2" if [ -d "$1" ]; then rm -rf -- "$1" fi cp --archive --reflink=always -- "$2" "$1" - touch -mr "$STAMPFILE2" -- "$1" + cp --archive --attributes-only --no-target-directory -- "$STAMPFILE2" "$1" fi fi }