From owner-svn-ports-all@FreeBSD.ORG Sun May 24 18:01:05 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CE739D5; Sun, 24 May 2015 18:01:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6CFB01FC1; Sun, 24 May 2015 18:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OI15rS039419; Sun, 24 May 2015 18:01:05 GMT (envelope-from riggs@FreeBSD.org) Received: (from riggs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OI14iu039413; Sun, 24 May 2015 18:01:04 GMT (envelope-from riggs@FreeBSD.org) Message-Id: <201505241801.t4OI14iu039413@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: riggs set sender to riggs@FreeBSD.org using -f From: Thomas Zander Date: Sun, 24 May 2015 18:01:04 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r387288 - in head/archivers/liblz4: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 18:01:05 -0000 Author: riggs Date: Sun May 24 18:01:03 2015 New Revision: 387288 URL: https://svnweb.freebsd.org/changeset/ports/387288 Log: Fix decompression in a pipeline: import fix from dev branch in https://github.com/Cyan4973/lz4/commit/58b5aadb1fc5d937e81c8f33e0e8290f2097c6bb PR: 200422 Submitted by: eborisch+FreeBSD@gmail.com Approved by: adamw (maintainer, implicit) Added: head/archivers/liblz4/files/ head/archivers/liblz4/files/patch-programs_Makefile (contents, props changed) head/archivers/liblz4/files/patch-programs_lz4cli.c (contents, props changed) head/archivers/liblz4/files/patch-programs_lz4io.c (contents, props changed) Modified: head/archivers/liblz4/Makefile Modified: head/archivers/liblz4/Makefile ============================================================================== --- head/archivers/liblz4/Makefile Sun May 24 17:45:55 2015 (r387287) +++ head/archivers/liblz4/Makefile Sun May 24 18:01:03 2015 (r387288) @@ -4,6 +4,7 @@ PORTNAME= lz4 PORTVERSION= 129 DISTVERSIONPREFIX= r +PORTREVISION= 1 CATEGORIES= archivers PKGNAMEPREFIX= lib Added: head/archivers/liblz4/files/patch-programs_Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/liblz4/files/patch-programs_Makefile Sun May 24 18:01:03 2015 (r387288) @@ -0,0 +1,21 @@ +--- programs/Makefile.orig 2015-05-07 11:23:39 UTC ++++ programs/Makefile +@@ -150,7 +150,7 @@ test-all: test test32 + test-travis: $(TRAVIS_TARGET) + + test-lz4-sparse: lz4 datagen +- @echo ---- test sparse file support ---- ++ @echo "\n ---- test sparse file support ----" + ./datagen -g5M -P100 > tmpSrc + ./lz4 -B4D tmpSrc | ./lz4 -dv --sparse > tmpB4 + diff -s tmpSrc tmpB4 +@@ -167,6 +167,9 @@ test-lz4-sparse: lz4 datagen + ./datagen -s1 -g1200007 -P100 | diff -s - tmpOdd + ls -ls tmpOdd + @rm tmp* ++ @echo "\n Compatibility with Console :" ++ ./lz4 COPYING | ./lz4 -d -c ++ ./lz4 COPYING | ./lz4 -d | cat + + test-lz4-contentSize: lz4 datagen + @echo ---- test original size support ---- Added: head/archivers/liblz4/files/patch-programs_lz4cli.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/liblz4/files/patch-programs_lz4cli.c Sun May 24 18:01:03 2015 (r387288) @@ -0,0 +1,11 @@ +--- programs/lz4cli.c.orig 2015-05-07 11:23:39 UTC ++++ programs/lz4cli.c +@@ -473,7 +473,7 @@ int main(int argc, char** argv) + if (multiple_inputs) input_filename = inFileNames[0], output_filename = (const char*)(inFileNames[0]); + if(!input_filename) { input_filename=stdinmark; } + +- /* Check if input or output are defined as console; trigger an error in this case */ ++ /* Check if input is defined as console; trigger an error in this case */ + if (!strcmp(input_filename, stdinmark) && IS_CONSOLE(stdin) ) badusage(); + + /* Check if benchmark is selected */ Added: head/archivers/liblz4/files/patch-programs_lz4io.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/liblz4/files/patch-programs_lz4io.c Sun May 24 18:01:03 2015 (r387288) @@ -0,0 +1,61 @@ +--- programs/lz4io.c.orig 2015-05-07 11:23:39 UTC ++++ programs/lz4io.c +@@ -303,6 +303,12 @@ static int LZ4IO_getFiles(const char* in + + if ( *pfoutput==0) EXM_THROW(13, "Pb opening %s", output_filename); + ++ if (g_sparseFileSupport) ++ { ++ long int ftr = ftell(*pfoutput); ++ if (ftr==-1) g_sparseFileSupport = 0; ++ } ++ + return 0; + } + +@@ -639,7 +645,7 @@ static unsigned LZ4IO_fwriteSparse(FILE* + if (!g_sparseFileSupport) /* normal write */ + { + size_t sizeCheck = fwrite(buffer, 1, bufferSize, file); +- if (sizeCheck != bufferSize) EXM_THROW(68, "Write error : cannot write decoded block"); ++ if (sizeCheck != bufferSize) EXM_THROW(70, "Write error : cannot write decoded block"); + return 0; + } + +@@ -647,7 +653,7 @@ static unsigned LZ4IO_fwriteSparse(FILE* + if (storedSkips > 1 GB) + { + int seekResult = fseek(file, 1 GB, SEEK_CUR); +- if (seekResult != 0) EXM_THROW(68, "1 GB skip error (sparse file support)"); ++ if (seekResult != 0) EXM_THROW(71, "1 GB skip error (sparse file support)"); + storedSkips -= 1 GB; + } + +@@ -667,12 +673,12 @@ static unsigned LZ4IO_fwriteSparse(FILE* + { + size_t sizeCheck; + seekResult = fseek(file, storedSkips, SEEK_CUR); +- if (seekResult) EXM_THROW(68, "Skip error (sparse file)"); ++ if (seekResult) EXM_THROW(72, "Skip error (sparse file)"); + storedSkips = 0; + seg0SizeT -= nb0T; + ptrT += nb0T; + sizeCheck = fwrite(ptrT, sizeT, seg0SizeT, file); +- if (sizeCheck != seg0SizeT) EXM_THROW(68, "Write error : cannot write decoded block"); ++ if (sizeCheck != seg0SizeT) EXM_THROW(73, "Write error : cannot write decoded block"); + } + ptrT += seg0SizeT; + } +@@ -689,10 +695,10 @@ static unsigned LZ4IO_fwriteSparse(FILE* + { + size_t sizeCheck; + int seekResult = fseek(file, storedSkips, SEEK_CUR); +- if (seekResult) EXM_THROW(68, "Skip error (end of block)"); ++ if (seekResult) EXM_THROW(74, "Skip error (end of block)"); + storedSkips = 0; + sizeCheck = fwrite(restPtr, 1, restEnd - restPtr, file); +- if (sizeCheck != (size_t)(restEnd - restPtr)) EXM_THROW(68, "Write error : cannot write decoded end of block"); ++ if (sizeCheck != (size_t)(restEnd - restPtr)) EXM_THROW(75, "Write error : cannot write decoded end of block"); + } + } +