From owner-svn-src-head@freebsd.org Wed Dec 6 09:53:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80321E9AE37; Wed, 6 Dec 2017 09:53:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57C8A6B10B; Wed, 6 Dec 2017 09:53:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB69rAmE031511; Wed, 6 Dec 2017 09:53:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB69rAHN031509; Wed, 6 Dec 2017 09:53:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201712060953.vB69rAHN031509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 6 Dec 2017 09:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326618 - head/sys/contrib/zstd/programs X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/sys/contrib/zstd/programs X-SVN-Commit-Revision: 326618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 09:53:11 -0000 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 */