[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sun Oct 16 00:10:43 UTC 2022


The branch, master has been updated
       via  35ecec97 A few more manpage clarifications.
       via  d76cabe5 Fix autoconf help strings (#389)
       via  b5544a95 Add info on single-file copying; tweak `--mkpath`.
       via  11bd2a4f Tweak NEWS.
       via  6ba434de Change fgrep to grep.
      from  32963514 Fix validation of "preN" git tags for git-version.h.

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 35ecec972a02f396ad3bc95cd71436bef41241b5
Author: Wayne Davison <wayne at opencoder.net>
Date:   Sat Oct 15 16:56:16 2022 -0700

    A few more manpage clarifications.

commit d76cabe54fa50723dcd3967831c9a31fd4a2845e
Author: Alexponomarev7 <Alex.ponomarev7 at ya.ru>
Date:   Sun Oct 16 01:54:27 2022 +0200

    Fix autoconf help strings (#389)

commit b5544a95b1c163d9bb98fc132a18f329d9d8028e
Author: Wayne Davison <wayne at opencoder.net>
Date:   Wed Oct 12 10:09:43 2022 -0700

    Add info on single-file copying; tweak `--mkpath`.

commit 11bd2a4fd60b794d3af3660705d2ef0f0f2b61ab
Author: Wayne Davison <wayne at opencoder.net>
Date:   Mon Oct 10 08:55:09 2022 -0700

    Tweak NEWS.

commit 6ba434de5c886b32103e6c265fe88c17e78945ee
Author: Wayne Davison <wayne at opencoder.net>
Date:   Thu Oct 6 22:18:48 2022 -0700

    Change fgrep to grep.

-----------------------------------------------------------------------

Summary of changes:
 NEWS.md             |  2 +-
 configure.ac        |  4 +--
 packaging/pkglib.py |  2 +-
 rsync.1.md          | 73 ++++++++++++++++++++++++++++++++++++++++-------------
 4 files changed, 59 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/NEWS.md b/NEWS.md
index 05476bee..24862dd0 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -71,7 +71,7 @@
   deprecation warnings and makes it easy to support more digest methods.  On
   newer systems, the MD4 digest is marked as legacy in the openssl code, which
   makes openssl refuse to support it via EVP.  You can choose to ignore this
-  and allow the included MD4 code to be used for older rsync connections (when
+  and allow rsync's MD4 code to be used for older rsync connections (when
   talking to an rsync prior to 3.0.0) or you can choose to configure rsync to
   tell openssl to enable legacy algorithms (see below).
 
diff --git a/configure.ac b/configure.ac
index 7fa6ff73..8ad6137e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -528,7 +528,7 @@ fi
 
 AC_MSG_CHECKING([whether to enable zstd compression])
 AC_ARG_ENABLE([zstd],
-        AC_HELP_STRING([--disable-zstd], [disable to omit zstd compression]))
+        AS_HELP_STRING([--disable-zstd], [disable to omit zstd compression]))
 AH_TEMPLATE([SUPPORT_ZSTD],
 [Undefine if you do not want zstd compression.  By default this is defined.])
 if test x"$enable_zstd" != x"no"; then
@@ -549,7 +549,7 @@ fi
 
 AC_MSG_CHECKING([whether to enable LZ4 compression])
 AC_ARG_ENABLE([lz4],
-        AC_HELP_STRING([--disable-lz4], [disable to omit LZ4 compression]))
+        AS_HELP_STRING([--disable-lz4], [disable to omit LZ4 compression]))
 AH_TEMPLATE([SUPPORT_LZ4],
 [Undefine if you do not want LZ4 compression.  By default this is defined.])
 if test x"$enable_lz4" != x"no"; then
diff --git a/packaging/pkglib.py b/packaging/pkglib.py
index 6f5557aa..c4c5741d 100644
--- a/packaging/pkglib.py
+++ b/packaging/pkglib.py
@@ -176,7 +176,7 @@ def mandate_gensend_hook():
         print('Creating hook file:', hook)
         cmd_chk(['./rsync', '-a', 'packaging/pre-push', hook])
     else:
-        ct = cmd_txt(['fgrep', 'make gensend', hook], discard='output')
+        ct = cmd_txt(['grep', 'make gensend', hook], discard='output')
         if ct.rc:
             die('Please add a "make gensend" into your', hook, 'script.')
 
diff --git a/rsync.1.md b/rsync.1.md
index b647f63f..a2302830 100644
--- a/rsync.1.md
+++ b/rsync.1.md
@@ -152,7 +152,41 @@ rsync daemon by leaving off the module name:
 
 >     rsync somehost.mydomain.com::
 
-See the following section for more details.
+## COPYING A SINGLE FILE
+
+Rsync has the ability to customize the destination file's name when copying a
+single item.  The rules for this are:
+
+- The transfer list must consist of a single item (either a file or an empty
+  directory)
+- The final element of the destination path must not exist as a directory
+- The destination path must not have been specified with a trailing slash
+
+Under those circumstances, rsync will set the name of the destination's single
+item to the last element of the destination path.
+
+For example, the following will copy the foo.c file as bar.c in the "dest" dir
+(assuming that bar.c isn't a directory):
+
+>     rsync -ai src/foo.c dest/bar.c
+
+This rule might accidentally bite you if you unknowingly copy a single item and
+specify a destination dir that doesn't exist (without using a trailing slash).
+For example:
+
+>     rsync -ai src/*.c dest/dir
+
+If the `*.c` only matched one file and dest/dir does not yet exist, then rsync
+copies the single .c file to the name "dir" in "dest".  To prevent this, it is
+safest to specify a destination path with a trailing slash when you want it to
+be treated as a directory:
+
+>     rsync -ai src/*.c dest/dir/
+
+If you want to copy a **non-empty** directory to a different name, specify the
+source path with a trailing slash:
+
+>     rsync -ai foo/ bar
 
 ## SORTED TRANSFER ORDER
 
@@ -1113,23 +1147,26 @@ expand it.
 
 0.  `--mkpath`
 
-    Create a missing path component of the destination arg.  This allows rsync
-    to create multiple levels of missing destination dirs and to create a path
-    in which to put a single renamed file.  Keep in mind that you'll need to
-    supply a trailing slash if you want the entire destination path to be
-    treated as a directory when copying a single arg (making rsync behave the
-    same way that it would if the path component of the destination had already
-    existed).
-
-    For example, the following creates a copy of file foo as bar in the sub/dir
-    directory, creating dirs "sub" and "sub/dir" if either do not yet exist:
-
-    >     rsync -ai --mkpath foo sub/dir/bar
-
-    If you instead ran the following, it would have created file foo in the
-    sub/dir/bar directory:
-
-    >     rsync -ai --mkpath foo sub/dir/bar/
+    Create a missing path component of the destination path. By default, rsync
+    allows only the final element of the destination path to not exist, which
+    is an attempt to help you to validate your destination path.  With this
+    option, rsync creates all the missing destination-path components just as
+    if `mkdir -p $DEST_PATH` had been run.
+
+    When specifying a destination path, including a trailing slash ensures that
+    rsync always treats the whole path as the directory name to be created,
+    even if the source arg is a single filename. See the [COPYING A SINGLE
+    FILE](#) section for full details on how rsync decides if a final
+    destination path element is a directory or not.
+
+    If you would like the newly-created destination dirs to match the dirs on
+    the sending side, you should be using [`--relative`](#opt) (`-R`) instead
+    of `--mkpath`.  For instance, the following two commands result in the same
+    destination tree, but it is only the second command that ensures that the
+    "some/extra/path" elements match the dirs on the sending side:
+
+    >     rsync -ai --mkpath host:some/extra/path/*.c some/extra/path/
+    >     rsync -aiR host:some/extra/path/*.c ./
 
 0.  `--links`, `-l`
 


-- 
The rsync repository.



More information about the rsync-cvs mailing list