[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Wed Jun 3 01:07:03 UTC 2020


The branch, master has been updated
       via  4c9fdb9f Handle --skip-compress right for new compressors
      from  e0d30a22 Mention that `rsync --version` outputs checksum & compress lists.

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


- Log -----------------------------------------------------------------
commit 4c9fdb9f747469a6cc7ac6232a3c4804a1ed53e7
Author: Wayne Davison <wayne at opencoder.net>
Date:   Tue Jun 2 17:58:24 2020 -0700

    Handle --skip-compress right for new compressors
    
    Some compressors can't completely turn off, so minimize the level
    when a file is being "skipped".

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

Summary of changes:
 rsync.yo       | 14 +++++++++-----
 rsyncd.conf.yo |  8 ++++++--
 token.c        | 16 +++++++++-------
 3 files changed, 24 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/rsync.yo b/rsync.yo
index 3db3f3e8..dfcda72b 100644
--- a/rsync.yo
+++ b/rsync.yo
@@ -2116,10 +2116,15 @@ dit(bf(--compress-level=NUM)) Explicitly set the compression level to use
 the bf(--compress) option is implied.
 
 dit(bf(--skip-compress=LIST)) Override the list of file suffixes that will
-not be compressed.  The bf(LIST) should be one or more file suffixes
-(without the dot) separated by slashes (/).
+be compressed as little as possible. Rsync sets the compression level on a
+per-file basis based on the file's suffix.
+If the compression algorithm has an "off" level (such as zlib/zlibx) then no
+compression occurs for those files.  Other algorithms have the level minimized
+to reduces the CPU usage as much as possible.
 
-You may specify an empty string to indicate that no file should be skipped.
+The bf(LIST) should be one or more file suffixes (without the dot) separated by
+slashes (/). You may specify an empty string to indicate that no files should
+be skipped.
 
 Simple character-class matching is supported: each must consist of a list
 of letters inside the square brackets (e.g. no special classes, such as
@@ -2132,8 +2137,7 @@ matches 2 suffixes):
 
 verb(    --skip-compress=gz/jpg/mp[34]/7z/bz2)
 
-The default list of suffixes that will not be compressed is this (in this
-version of rsync):
+The default file suffixes in the skip-compress list in this version of rsync are:
 
 bf(7z)
 bf(ace)
diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
index d57d0277..aac4a7f2 100644
--- a/rsyncd.conf.yo
+++ b/rsyncd.conf.yo
@@ -824,13 +824,17 @@ dit(bf(dont compress)) This parameter allows you to select
 filenames based on wildcard patterns that should not be compressed
 when pulling files from the daemon (no analogous parameter exists to
 govern the pushing of files to a daemon).
-Compression is expensive in terms of CPU usage, so it
+Compression can be expensive in terms of CPU usage, so it
 is usually good to not try to compress files that won't compress well,
 such as already compressed files.
 
 The "dont compress" parameter takes a space-separated list of
 case-insensitive wildcard patterns. Any source filename matching one
-of the patterns will not be compressed during transfer.
+of the patterns will be compressed as little as possible during the
+transfer.
+If the compression algorithm has an "off" level (such as zlib/zlibx) then no
+compression occurs for those files.  Other algorithms have the level minimized
+to reduces the CPU usage as much as possible.
 
 See the bf(--skip-compress) parameter in the bf(rsync)(1) manpage for the list
 of file suffixes that are not compressed by default.  Specifying a value
diff --git a/token.c b/token.c
index bea37f21..f169b756 100644
--- a/token.c
+++ b/token.c
@@ -39,7 +39,9 @@ extern char *skip_compress;
 #define Z_INSERT_ONLY Z_SYNC_FLUSH
 #endif
 
-static int compression_level, per_file_default_level;
+static int compression_level; /* The compression level for the current file. */
+static int skip_compression_level; /* The least possible compressing for handling skip-compress files. */
+static int per_file_default_level; /* The default level that each new file gets prior to checking its suffix. */
 
 struct suffix_tree {
 	struct suffix_tree *sibling;
@@ -60,13 +62,13 @@ void init_compression_level(void)
 		min_level = 1;
 		max_level = Z_BEST_COMPRESSION;
 		def_level = 6; /* Z_DEFAULT_COMPRESSION is -1, so set it to the real default */
-		off_level = Z_NO_COMPRESSION;
+		off_level = skip_compression_level = Z_NO_COMPRESSION;
 		if (do_compression_level == Z_DEFAULT_COMPRESSION)
 			do_compression_level = def_level;
 		break;
 #ifdef SUPPORT_ZSTD
 	case CPRES_ZSTD:
-		min_level = ZSTD_minCLevel();
+		min_level = skip_compression_level = ZSTD_minCLevel();
 		max_level = ZSTD_maxCLevel();
 		def_level = 3;
 		off_level = CLVL_NOT_SPECIFIED;
@@ -74,7 +76,7 @@ void init_compression_level(void)
 #endif
 #ifdef SUPPORT_LZ4
 	case CPRES_LZ4:
-		min_level = 0;
+		min_level = skip_compression_level = 0;
 		max_level = 0;
 		def_level = 0;
 		off_level = CLVL_NOT_SPECIFIED;
@@ -204,7 +206,7 @@ static void init_set_compression(void)
 			/* Optimize a match-string of "*". */
 			*match_list = '\0';
 			suftree = NULL;
-			per_file_default_level = 0;
+			per_file_default_level = skip_compression_level;
 			break;
 		}
 
@@ -241,7 +243,7 @@ void set_compression(const char *fname)
 
 	for (s = match_list; *s; s += strlen(s) + 1) {
 		if (iwildmatch(s, fname)) {
-			compression_level = 0;
+			compression_level = skip_compression_level;
 			return;
 		}
 	}
@@ -261,7 +263,7 @@ void set_compression(const char *fname)
 		}
 		if ((ltr = *++s) == '\0') {
 			if (node->word_end)
-				compression_level = 0;
+				compression_level = skip_compression_level;
 			return;
 		}
 		if (!(node = node->child))


-- 
The rsync repository.



More information about the rsync-cvs mailing list