From 9e891f0c0f7574730aa1388028d0b46a5c61e3c0 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Wed, 17 May 2023 09:25:30 +0800 Subject: [PATCH] Use config file rather than hard-code prog names for zstd --- logrotate-3.21.0-use-zstd-by-default.patch | 52 +++++++--------------- logrotate.spec | 13 +++--- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/logrotate-3.21.0-use-zstd-by-default.patch b/logrotate-3.21.0-use-zstd-by-default.patch index 018df0a..b664841 100644 --- a/logrotate-3.21.0-use-zstd-by-default.patch +++ b/logrotate-3.21.0-use-zstd-by-default.patch @@ -5,13 +5,13 @@ \fBcompresscmd\fR Specifies which command to use to compress log files. The default is -\fBgzip\fR(1). See also \fBcompress\fR. -+\fBzstd\fR(1). See also \fBcompress\fR. ++\fBzstd\fR(1) via config file setting. See also \fBcompress\fR. .TP \fBuncompresscmd\fR Specifies which command to use to uncompress log files. The default is -\fBgunzip\fR(1). -+\fBunzstd\fR(1). ++\fBunzstd\fR(1) via config file setting. .TP \fBcompressext\fR @@ -20,7 +20,7 @@ \fBcompressoptions\fR Command line options may be passed to the compression program, if one is -in use. The default, for \fBgzip\fR(1), is "\-6" (biased towards high -+in use. The default, for \fBzstd\fR(1), is "\-3" (biased towards high ++in use. The default, for \fBzstd\fR(1), is "\-10" (biased towards high compression at the expense of speed). If you use a different compression command, you may need to change the \fBcompressoptions\fR to match. @@ -42,13 +42,13 @@ \fBcompresscmd\fR Specifies which command to use to compress log files. The default is -\fBgzip\fR(1). See also \fBcompress\fR. -+\fBzstd\fR(1). See also \fBcompress\fR. ++\fBzstd\fR(1) via config file setting. See also \fBcompress\fR. .TP \fBuncompresscmd\fR Specifies which command to use to uncompress log files. The default is -\fBgunzip\fR(1). -+\fBunzstd\fR(1). ++\fBunzstd\fR(1) via config file setting. .TP \fBcompressext\fR @@ -57,7 +57,7 @@ \fBcompressoptions\fR Command line options may be passed to the compression program, if one is -in use. The default, for \fBgzip\fR(1), is "\-6" (biased towards high -+in use. The default, for \fBzstd\fR(1), is "\-3" (biased towards high ++in use. The default, for \fBzstd\fR(1), is "\-10" (biased towards high compression at the expense of speed). If you use a different compression command, you may need to change the \fBcompressoptions\fR to match. @@ -72,34 +72,16 @@ .BR mail (1), .BR shred (1), .BR strftime (3), ---- logrotate-3.21.0/test/test-0108.sh.orig 2023-05-15 14:06:11.509410174 +0800 -+++ logrotate-3.21.0/test/test-0108.sh 2023-05-15 14:08:40.203410174 +0800 -@@ -17,8 +17,8 @@ +--- logrotate-3.21.0/examples/logrotate.conf.orig 2023-05-15 13:52:16.756523283 +0800 ++++ logrotate-3.21.0/examples/logrotate.conf 2023-05-17 00:33:34.038538526 +0800 +@@ -16,6 +16,10 @@ - $RLR test-config.108 --force || exit 23 + # uncomment this if you want your log files compressed + #compress ++compresscmd /usr/bin/zstd ++uncompresscmd /usr/bin/unzstd ++compressoptions --rm -10 ++compressext .zst --atime=$($STAT_ATIME_FORMAT test.log.1.gz) --mtime=$($STAT_MTIME_FORMAT test.log.1.gz) -+atime=$($STAT_ATIME_FORMAT test.log.1.zst) -+mtime=$($STAT_MTIME_FORMAT test.log.1.zst) - expected_time=946684800 - - if [ "$atime" -ne $expected_time ]; then -@@ -34,5 +34,5 @@ - # check last, to not modify atime - checkoutput < - 3.21.0-3 +- Use config file rather than hard-code prog names for zstd + * Mon May 15 2023 Funda Wang - 3.21.0-2 - Use zstd compression by default -- Gitee