Author: bapt
Date: Wed Dec 6 09:53:10 2017
New Revision: 326618
URL: https://svnweb.freebsd.org/changeset/base/326618
Log:
Revert local changes made to make zstd(1) frontend behave like gzip(1) and
friends
This change was made to allow zstd(1) to be a dropin replacement for gzip(1)
and
friends, allowing easy integration, in particular with newsyslog(8). At the
price of having a zstd(1) command which by default behaves differently than
what
upstream default, confusing users.
newsyslog(8) has been adapted to now be more flexible in what it accepts as
compression program, so we can switch back zstd(1) to its default behaviour
Reported by: many
Modified:
head/sys/contrib/zstd/programs/fileio.c
head/sys/contrib/zstd/programs/zstdcli.c
Modified: head/sys/contrib/zstd/programs/fileio.c
==============================================================================
--- head/sys/contrib/zstd/programs/fileio.c Wed Dec 6 09:44:35 2017
(r326617)
+++ head/sys/contrib/zstd/programs/fileio.c Wed Dec 6 09:53:10 2017
(r326618)
@@ -203,7 +203,7 @@ static U32 g_dictIDFlag = 1;
void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; }
static U32 g_checksumFlag = 1;
void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag =
checksumFlag; }
-static U32 g_removeSrcFile = 1;
+static U32 g_removeSrcFile = 0;
void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); }
static U32 g_memLimit = 0;
void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; }
Modified: head/sys/contrib/zstd/programs/zstdcli.c
==============================================================================
--- head/sys/contrib/zstd/programs/zstdcli.c Wed Dec 6 09:44:35 2017
(r326617)
+++ head/sys/contrib/zstd/programs/zstdcli.c Wed Dec 6 09:53:10 2017
(r326618)
@@ -68,7 +68,7 @@
#define MB *(1 <<20)
#define GB *(1U<<30)
-#define DISPLAY_LEVEL_DEFAULT 1
+#define DISPLAY_LEVEL_DEFAULT 2
static const char* g_defaultDictName = "dictionary";
static const unsigned g_defaultMaxDictSize = 110 KB;
@@ -421,7 +421,7 @@ int main(int argCount, const char* argv[])
/* preset behaviors */
if (exeNameMatch(programName, ZSTD_ZSTDMT)) nbThreads=0;
if (exeNameMatch(programName, ZSTD_UNZSTD)) operation=zom_decompress;
- if (exeNameMatch(programName, ZSTD_CAT)) { operation=zom_decompress;
forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1;
FIO_setRemoveSrcFile(0); }
+ if (exeNameMatch(programName, ZSTD_CAT)) { operation=zom_decompress;
forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; }
if (exeNameMatch(programName, ZSTD_GZ)) { suffix = GZ_EXTENSION;
FIO_setCompressionType(FIO_gzipCompression); FIO_setRemoveSrcFile(1); } /*
behave like gzip */
if (exeNameMatch(programName, ZSTD_GUNZIP)) { operation=zom_decompress;
FIO_setRemoveSrcFile(1); } /* behave
like gunzip */
if (exeNameMatch(programName, ZSTD_GZCAT)) { operation=zom_decompress;
forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; }
/* behave like gzcat */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"