[PATCH 1/1] compare-trees: add --times --no-times

1 view
Skip to first unread message

Rob Browning

unread,
Jul 1, 2022, 6:03:38 PM7/1/22
to bup-...@googlegroups.com
Signed-off-by: Rob Browning <r...@defaultvalue.org>
---

Proposed.

dev/compare-trees | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dev/compare-trees b/dev/compare-trees
index 584a5c7e..2d2ffa8f 100755
--- a/dev/compare-trees
+++ b/dev/compare-trees
@@ -15,16 +15,22 @@ OPTIONS:
Check file content (default)
-x
Don't check file content (rely on size/timestamps, etc.)
+ --times
+ --no-times
+ Check or don't check timestamps (checking is the default)
EOF
}

verify_content=" --checksum"
+verify_times=' --times'

while test $# -gt 0; do
case "$1" in
-h) usage; exit 0;;
-c) verify_content=" --checksum"; shift;;
-x) verify_content=""; shift;;
+ --times) verify_times=' --times'; shift;;
+ --no-times) verify_times=''; shift;;
-*) usage 1>&2; exit 2;;
[^-]*) break;;
esac
@@ -42,7 +48,10 @@ dest="$2"
tmpfile="$(mktemp /tmp/bup-test-XXXXXXX)" || exit $?
trap "rm -rf '$tmpfile'" EXIT || exit $?

-rsync_opts="-niaH$verify_content --delete"
+rsync_opts="-rlpgoD" # --archive, without --times
+rsync_opts="$rsync_opts -niH --delete"
+rsync_opts="$rsync_opts$verify_content"
+rsync_opts="$rsync_opts$verify_times"

rsync_version=$(rsync --version)
if [[ ! "$rsync_version" =~ "ACLs" ]] || [[ "$rsync_version" =~ "no ACLs" ]]; then
--
2.30.2

Rob Browning

unread,
Jul 9, 2022, 2:45:23 PM7/9/22
to bup-...@googlegroups.com
Rob Browning <r...@defaultvalue.org> writes:

> Signed-off-by: Rob Browning <r...@defaultvalue.org>

Pushed.

--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Reply all
Reply to author
Forward
0 new messages