[PATCH] Fix the counting of device files and symlinks

2023-05-16 Thread Marc Aurèle La France via rsync
Device files should be counted as devices, not symlinks.

Marc.

diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/delete.c devel-3.2.7/delete.c
--- rsync-3.2.7/delete.c2020-06-13 20:15:02.0 -0600
+++ devel-3.2.7/delete.c2020-06-13 20:15:02.0 -0600
@@ -188,7 +188,7 @@ enum delret delete_item(char *fbuf, uint16 mode, uint16 
flags)
stats.deleted_symlinks++;
 #endif
else if (IS_DEVICE(mode))
-   stats.deleted_symlinks++;
+   stats.deleted_devices++;
else
stats.deleted_specials++;
}
diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/flist.c devel-3.2.7/flist.c
--- rsync-3.2.7/flist.c 2022-10-02 10:54:54.0 -0600
+++ devel-3.2.7/flist.c 2022-10-02 10:54:54.0 -0600
@@ -2659,7 +2659,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
} else if (S_ISLNK(file->mode))
stats.num_symlinks++;
else if (IS_DEVICE(file->mode))
-   stats.num_symlinks++;
+   stats.num_devices++;
else
stats.num_specials++;


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[PATCH] Fix documentation typo

2023-05-16 Thread Marc Aurèle La France via rsync
s/receiveing/receiving/

Marc.

diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/rsync.1.md 
devel-3.2.7/rsync.1.md
--- rsync-3.2.7/rsync.1.md  2022-10-16 13:27:30.0 -0600
+++ devel-3.2.7/rsync.1.md  2022-10-16 13:27:30.0 -0600
@@ -245,7 +245,7 @@ to be copied to different destination directories using 
more than one copy.

 While a copy of a case-ignoring filesystem to a case-ignoring filesystem can
 work out fairly well, if no `--delete-during` or `--delete-before` option is
-active, rsync can potentially update an existing file on the receiveing side
+active, rsync can potentially update an existing file on the receiving side
 without noticing that the upper-/lower-case of the filename should be changed
 to match the sender.


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[PATCH] Add --omit-{device,special}-times options

2023-05-16 Thread Marc Aurèle La France via rsync
Similar to --omit-{dir,link}-times:

--omit-device-times  omit device files from --times
--omit-special-times omit sockets and fifos from --times

Also, fix corner case that allows --omit-dir-times to be ignored.  See
unchanged_attrs() and recv_generator()'s call to try_dests_non().

Marc.

diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/generator.c 
devel-3.2.7/generator.c
--- rsync-3.2.7/generator.c 2022-09-15 11:12:02.0 -0600
+++ devel-3.2.7/generator.c 2022-09-15 11:12:02.0 -0600
@@ -47,6 +47,8 @@ extern int preserve_perms;
 extern int preserve_mtimes;
 extern int omit_dir_times;
 extern int omit_link_times;
+extern int omit_device_times;
+extern int omit_special_times;
 extern int delete_mode;
 extern int delete_before;
 extern int delete_during;
@@ -482,7 +484,12 @@ int unchanged_attrs(const char *fname, struct file_struct 
*file, stat_x *sxp)
return 0;
 #endif
} else {
-   if (preserve_mtimes && any_time_differs(sxp, file, fname))
+   int keep_time = !preserve_mtimes ? 0
+   : S_ISDIR(file->mode) ? !omit_dir_times
+   : IS_DEVICE(file->mode) ? !omit_device_times
+   : IS_SPECIAL(file->mode) ? !omit_special_times
+   : 1;
+   if (keep_time && any_time_differs(sxp, file, fname))
return 0;
if (perms_differ(file, sxp))
return 0;
@@ -509,6 +516,8 @@ void itemize(const char *fnamecmp, struct file_struct 
*file, int ndx, int statret,
int keep_time = !preserve_mtimes ? 0
: S_ISDIR(file->mode) ? !omit_dir_times
: S_ISLNK(file->mode) ? !omit_link_times
+   : IS_DEVICE(file->mode) ? !omit_device_times
+   : IS_SPECIAL(file->mode) ? !omit_special_times
: 1;

if (S_ISREG(file->mode) && F_LENGTH(file) != sxp->st.st_size)
diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/options.c devel-3.2.7/options.c
--- rsync-3.2.7/options.c   2022-09-10 14:14:42.0 -0600
+++ devel-3.2.7/options.c   2022-09-10 14:14:42.0 -0600
@@ -66,6 +66,8 @@ int preserve_atimes = 0;
 int preserve_crtimes = 0;
 int omit_dir_times = 0;
 int omit_link_times = 0;
+int omit_device_times = 0;
+int omit_special_times = 0;
 int trust_sender = 0;
 int update_only = 0;
 int open_noatime = 0;
@@ -646,6 +648,10 @@ static struct poptOption long_options[] = {
   {"omit-link-times", 'J', POPT_ARG_VAL,&omit_link_times, 1, 0, 0 },
   {"no-omit-link-times",0, POPT_ARG_VAL,&omit_link_times, 0, 0, 0 },
   {"no-J", 0,  POPT_ARG_VAL,&omit_link_times, 0, 0, 0 },
+  {"omit-device-times",0,  POPT_ARG_VAL,&omit_device_times, 1, 0, 0 },
+  {"no-omit-device-times",0, POPT_ARG_VAL,  &omit_device_times, 0, 0, 0 },
+  {"omit-special-times",0, POPT_ARG_VAL,&omit_special_times, 1, 0, 0 },
+  {"no-omit-special-times",0, POPT_ARG_VAL, &omit_special_times, 0, 0, 0 },
   {"modify-window",   '@', POPT_ARG_INT,&modify_window, OPT_MODIFY_WINDOW, 
0, 0 },
   {"super",0,  POPT_ARG_VAL,&am_root, 2, 0, 0 },
   {"no-super", 0,  POPT_ARG_VAL,&am_root, 0, 0, 0 },
@@ -2815,6 +2821,10 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--size-only";
if (do_stats)
args[ac++] = "--stats";
+   if (omit_device_times)
+   args[ac++] = "--omit-device-times";
+   if (omit_special_times)
+   args[ac++] = "--omit-special-times";
} else {
if (skip_compress)
args[ac++] = safe_arg("--skip-compress", skip_compress);
diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/rsync.1.md 
devel-3.2.7/rsync.1.md
--- rsync-3.2.7/rsync.1.md  2022-10-16 13:27:30.0 -0600
+++ devel-3.2.7/rsync.1.md  2022-10-16 13:27:30.0 -0600
@@ -463,6 +463,8 @@ has its own detailed description later in this manpage.
 --crtimes, -Npreserve create times (newness)
 --omit-dir-times, -O omit directories from --times
 --omit-link-times, -Jomit symlinks from --times
+--omit-device-times  omit device files from --times
+--omit-special-times omit sockets and fifos from --times
 --super  receiver attempts super-user activities
 --fake-super store/recover privileged attrs using xattrs
 --sparse, -S turn sequences of nulls into sparse blocks
@@ -1654,6 +1656,16 @@ expand it.
 This tells rsync to omit symlinks when it is preserving modification,
 access, and create times.

+0.  `--omit-device-times`
+
+This tells rsync to omit device files when it is preserving modification,
+access, and create times.
+
+0.  `--omit-special-times`
+
+This tells rsync to omit sockets and fifos when it is preserving
+modification, access, and create

Re: [PATCH] Add --omit-{device,special}-times options

2023-05-26 Thread Marc Aurèle La France via rsync

On Fri, 26 May 2023, Wayne Davison wrote:

On Tue, May 16, 2023, Marc Aurèle La France wrote:



Similar to --omit-{dir,link}-times:



--omit-device-times  omit device files from --times
--omit-special-times omit sockets and fifos from --times



I'm not convinced these are needed at present.


I'll counter by saying that keeping inode times up to date for these isn't 
terribly useful.



Also, fix corner case that allows --omit-dir-times to be ignored.  See
unchanged_attrs() and recv_generator()'s call to try_dests_non().



Directories aren't linked together, so they aren't passed to
unchanged_attrs() or try_dests_non().


This seems false to me given recv_generator()'s first call to 
try_dests_non() (and therefore unchanged_attrs()) is within an "if 
(is_dir) { }" block.


Marc.-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: question about the recursive algorithm

2025-01-16 Thread Marc Aurèle La France via rsync

On Thu, 2025-Jan-16, BP via rsync wrote:


I always run rsync as follows: "sudo rsync -PaSHAXvi --del DIR1/
DIR2". I would think that whenever I see in the output of this rsync
command a few lines of the form A/B/... and then further down in the
output again a few lines of the form A/B/... (dots are dirs or files),
then every line between such two lines is also of this form.



I then discovered that this is incorrect (incidentally, the order of the
deleted files here below is not alphabetical?!):



f+ A/B/folder1/file1.mkv
f+ A/B/folder1/file2.mkv

*deleting A/C/file3.tex
*deleting A/C/file4.pdf
*deleting A/C/file5.txt
cd+ A/B/folder2/

f+ A/B/folder2/file6.html



Is this expected? Reading the manual (section about inductive recursion)
I would think that the only case where rsync jumps unfinished dirs would
be the creation of empty dirs.



But here's the real question: is my hypothesis correct when we restrict
to just lines starting by >, and also to just lines which start by
*deleting? In other words, does the sender never jump folder and back,
and same the receiver (but combined they might, as shown above)?



I would grately appreciate insights. Please, let me know!


Please see ...

https://bugzilla.samba.org/show_bug.cgi?id=6741

Marc.


--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: [Question] Building without iconv

2025-03-03 Thread Marc Aurèle La France via rsync

On Mon, 2025-Mar-03, Randall S. Becker via rsync wrote:


I am trying to build a 64-bit version of rsync. My issue is that I do not
have a 64-bit libiconv.so
or libiconv.a available. The platform I am on only has 32-bit builds. The
--disable-iconv option
in configure is not actually disabling iconv. Is there a different option to
disable this, at least
temporarily?


Try --disable-locale.

Marc.


--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html