CVS commit: src/external/zlib/pigz/dist

2015-01-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jan 13 02:36:22 UTC 2015

Modified Files:
src/external/zlib/pigz/dist: pigz.c

Log Message:
merge 
https://github.com/madler/pigz/commit/fdad1406b3ec809f4954ff7cdf9e99eb18c2458f

--
When decompressing with -N or -NT, strip any path from header name.

This uses the path of the compressed file combined with the name
from the header as the name of the decompressed output file.  Any
path information in the header name is stripped.  This avoids a
possible vulnerability where absolute or descending paths are put
in the gzip header.
--


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/zlib/pigz/dist/pigz.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/zlib/pigz/dist/pigz.c
diff -u src/external/zlib/pigz/dist/pigz.c:1.1.1.2 src/external/zlib/pigz/dist/pigz.c:1.2
--- src/external/zlib/pigz/dist/pigz.c:1.1.1.2	Sun Jun 15 17:37:21 2014
+++ src/external/zlib/pigz/dist/pigz.c	Tue Jan 13 02:36:22 2015
@@ -3502,26 +3502,35 @@ local void process(char *path)
   (use -f to force));
 }
 else {
-char *to, *repl;
+char *to = g.inf, *sufx = ;
+size_t pre = 0;
 
-/* use header name for output when decompressing with -N */
-to = g.inf;
-if (g.decode  (g.headis  1) != 0  g.hname != NULL) {
-to = g.hname;
-len = strlen(g.hname);
+/* select parts of the output file name */
+if (g.decode) {
+/* for -dN or -dNT, use the path from the input file and the name
+   from the header, stripping any path in the header name */
+if ((g.headis  1) != 0  g.hname != NULL) {
+pre = justname(g.inf) - g.inf;
+to = justname(g.hname);
+len = strlen(to);
+}
+/* for -d or -dNn, replace abbreviated suffixes */
+else if (strcmp(to + len, .tgz) == 0)
+sufx = .tar;
 }
-
-/* replace .tgx with .tar when decoding */
-repl = g.decode  strcmp(to + len, .tgz) ?  : .tar;
+else
+/* add appropriate suffix when compressing */
+sufx = g.sufx;
 
 /* create output file and open to write */
-g.outf = MALLOC(len + (g.decode ? strlen(repl) : strlen(g.sufx)) + 1);
+g.outf = MALLOC(pre + len + strlen(sufx) + 1);
 if (g.outf == NULL)
 bail(not enough memory, );
-memcpy(g.outf, to, len);
-strcpy(g.outf + len, g.decode ? repl : g.sufx);
+memcpy(g.outf, g.inf, pre);
+memcpy(g.outf + pre, to, len);
+strcpy(g.outf + pre + len, sufx);
 g.outd = open(g.outf, O_CREAT | O_TRUNC | O_WRONLY |
- (g.force ? 0 : O_EXCL), 0600);
+  (g.force ? 0 : O_EXCL), 0600);
 
 /* if exists and not -f, give user a chance to overwrite */
 if (g.outd  0  errno == EEXIST  isatty(0)  g.verbosity) {



CVS commit: src/external/zlib/pigz/dist

2014-06-15 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Sun Jun 15 17:53:19 UTC 2014

Modified Files:
src/external/zlib/pigz/dist: pigz.1
Removed Files:
src/external/zlib/pigz/dist: pigz.ps

Log Message:
Update pigz to 2.3.1


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/zlib/pigz/dist/pigz.1
cvs rdiff -u -r1.1.1.1 -r0 src/external/zlib/pigz/dist/pigz.ps

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/zlib/pigz/dist/pigz.1
diff -u src/external/zlib/pigz/dist/pigz.1:1.3 src/external/zlib/pigz/dist/pigz.1:1.4
--- src/external/zlib/pigz/dist/pigz.1:1.3	Sat Jul 20 21:40:05 2013
+++ src/external/zlib/pigz/dist/pigz.1	Sun Jun 15 17:53:19 2014
@@ -11,6 +11,11 @@
 .Op Fl b Ar blocksize
 .Op Fl p Ar threads
 .Op Fl S Ar suffix
+.Op Fl 11
+.Op Fl F
+.Op Fl I Ar iterations
+.Op Fl M Ar maxsplits
+.Op Fl O
 .Op Ar
 .Nm unpigz
 .Op Fl cfhiKkLlNnqRrTtz
@@ -96,7 +101,12 @@ and
 or
 .Fl Fl best
 indicates the slowest compression method (best compression).
-Level 0 is no compression.
+.Fl 0
+is no compression.
+.Fl 11
+gives a few percent better compression at a severe cost in execution time.
+The default is
+.Fl 6 .
 .It Fl b, Fl Fl blocksize Ar mmm
 Set compression block size to
 .Ar mmm
@@ -131,6 +141,8 @@ Allow up to n processes (default is the 
 Print no messages, even on error.
 .It Fl r, Fl Fl recursive
 Process the contents of all subdirectories.
+.It Fl R, Fl Fl rsyncable
+Input-determined block locations for rsync.
 .It Fl S, Fl Fl suffix Ar .sss
 Use suffix
 .Ar .sss
@@ -149,6 +161,15 @@ Provide more verbose output.
 Compress to zlib
 .Pq Pa .zz
 instead of gzip format.
+.It Fl F, Fl Fl first
+If compressing at level 11, do iterations first, before block split (default is last).
+.It Fl I, Fl Fl iterations Ar n
+If compressing at level 11, number of iterations for optimization (default 15).
+.It Fl M, Fl Fl maxsplits Ar n
+If compressing at level 11, maximum number of split blocks (default 15).
+.It Fl O, Fl Fl oneblock
+If compressing at level 11, do not split into smaller blocks (default is
+block splitting).
 .El
 .Sh COPYRIGHT NOTICE
 This software is provided 'as-is', without any express or implied



CVS commit: src/external/zlib/pigz/dist

2014-06-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jun 15 19:41:04 UTC 2014

Modified Files:
src/external/zlib/pigz/dist: pigz.1

Log Message:
Sort options. Sort option descriptions. Add RCS Id.
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/zlib/pigz/dist/pigz.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/zlib/pigz/dist/pigz.1
diff -u src/external/zlib/pigz/dist/pigz.1:1.4 src/external/zlib/pigz/dist/pigz.1:1.5
--- src/external/zlib/pigz/dist/pigz.1:1.4	Sun Jun 15 17:53:19 2014
+++ src/external/zlib/pigz/dist/pigz.1	Sun Jun 15 19:41:04 2014
@@ -1,4 +1,5 @@
-.Dd June 19, 2010
+.\ $NetBSD: pigz.1,v 1.5 2014/06/15 19:41:04 wiz Exp $
+.Dd June 15, 2014
 .Dt PIGZ 1
 .Os
 .Sh NAME
@@ -7,15 +8,13 @@
 .Nd compress or expand files
 .Sh SYNOPSIS
 .Nm
-.Op Fl 0..9cdfhiKkLlNnqRrTtz
-.Op Fl b Ar blocksize
-.Op Fl p Ar threads
-.Op Fl S Ar suffix
+.Op Fl 0..9cdFfhiKkLlNnqORrTtz
 .Op Fl 11
-.Op Fl F
+.Op Fl b Ar blocksize
 .Op Fl I Ar iterations
 .Op Fl M Ar maxsplits
-.Op Fl O
+.Op Fl p Ar threads
+.Op Fl S Ar suffix
 .Op Ar
 .Nm unpigz
 .Op Fl cfhiKkLlNnqRrTtz
@@ -32,7 +31,8 @@ The compressed data is written in order 
 value is calculated from the individual check values.
 .Pp
 The compressed data format generated is in the gzip, zlib, or single-entry
-zip format using the deflate compression method.  The compression produces
+zip format using the deflate compression method.
+The compression produces
 partial raw deflate streams which are concatenated by a single write thread
 and wrapped with the appropriate header and trailer, where the trailer
 contains the combined check value.
@@ -52,7 +52,7 @@ The default input block size is 128K, bu
 .Fl b
 option.
 The number of compress threads is set by default to the number
-of online processors, which can be changed using the 
+of online processors, which can be changed using the
 .Fl p
 option.
 Specifying
@@ -115,10 +115,14 @@ K (default 128KiB).
 Write all processed output to stdout (won't delete).
 .It Fl d, Fl Fl decompress, Fl Fl uncompress
 Decompress the compressed input.
+.It Fl F, Fl Fl first
+If compressing at level 11, do iterations first, before block split (default is last).
 .It Fl f, Fl Fl force
 Force overwrite, compress .gz, links, and to terminal.
 .It Fl h, Fl Fl help
 Display a help screen and quit.
+.It Fl I, Fl Fl iterations Ar n
+If compressing at level 11, number of iterations for optimization (default 15).
 .It Fl i, Fl Fl independent
 Compress blocks independently for damage recovery.
 .It Fl K, Fl Fl zip
@@ -131,18 +135,23 @@ Display the
 license and quit.
 .It Fl l, Fl Fl list
 List the contents of the compressed input.
+.It Fl M, Fl Fl maxsplits Ar n
+If compressing at level 11, maximum number of split blocks (default 15).
 .It Fl N, Fl Fl name
 Store/restore file name and mod time in/from header.
 .It Fl n, Fl Fl no-name
 Do not store or restore file name in/from header.
+.It Fl O, Fl Fl oneblock
+If compressing at level 11, do not split into smaller blocks (default is
+block splitting).
 .It Fl p, Fl Fl processes Ar n
 Allow up to n processes (default is the number of online processors)
 .It Fl q, Fl Fl quiet, Fl Fl silent
 Print no messages, even on error.
-.It Fl r, Fl Fl recursive
-Process the contents of all subdirectories.
 .It Fl R, Fl Fl rsyncable
 Input-determined block locations for rsync.
+.It Fl r, Fl Fl recursive
+Process the contents of all subdirectories.
 .It Fl S, Fl Fl suffix Ar .sss
 Use suffix
 .Ar .sss
@@ -161,15 +170,6 @@ Provide more verbose output.
 Compress to zlib
 .Pq Pa .zz
 instead of gzip format.
-.It Fl F, Fl Fl first
-If compressing at level 11, do iterations first, before block split (default is last).
-.It Fl I, Fl Fl iterations Ar n
-If compressing at level 11, number of iterations for optimization (default 15).
-.It Fl M, Fl Fl maxsplits Ar n
-If compressing at level 11, maximum number of split blocks (default 15).
-.It Fl O, Fl Fl oneblock
-If compressing at level 11, do not split into smaller blocks (default is
-block splitting).
 .El
 .Sh COPYRIGHT NOTICE
 This software is provided 'as-is', without any express or implied



CVS commit: src/external/zlib/pigz/dist

2010-06-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jun 19 14:45:39 UTC 2010

Modified Files:
src/external/zlib/pigz/dist: pigz.1

Log Message:
Convert to mdoc. Sort options.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/zlib/pigz/dist/pigz.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/zlib/pigz/dist/pigz.1
diff -u src/external/zlib/pigz/dist/pigz.1:1.1.1.1 src/external/zlib/pigz/dist/pigz.1:1.2
--- src/external/zlib/pigz/dist/pigz.1:1.1.1.1	Thu Jun 17 06:05:09 2010
+++ src/external/zlib/pigz/dist/pigz.1	Sat Jun 19 14:45:39 2010
@@ -1,187 +1,160 @@
-.TH PIGZ 1 local
-.SH NAME
-pigz, unpigz \- compress or expand files
-.SH SYNOPSIS
-.ll +8
-.B pigz
-.RB [  \-cdfhikKlLnNqrRtTz0..9  ]
-[
-.B -b
-.I blocksize
-]
-[
-.B -p
-.I threads
-]
-[
-.B -S
-.I suffix
-]
-[
-.I name \...
-]
-.ll -8
-.br
-.B unpigz
-.RB [  \-cfhikKlLnNqrRtTz  ]
-[
-.B -b
-.I blocksize
-]
-[
-.B -p
-.I threads
-]
-[
-.B -S
-.I suffix
-]
-[
-.I name \...
-]
-.SH DESCRIPTION
-.I Pigz
+.Dd June 19, 2010
+.Dt PIGZ 1
+.Os
+.Sh NAME
+.Nm pigz ,
+.Nm unpigz
+.Nd compress or expand files
+.Sh SYNOPSIS
+.Nm
+.Op Fl 0..9cdfhiKkLlNnqRrTtz
+.Op Fl b Ar blocksize
+.Op Fl p Ar threads
+.Op Fl S Ar suffix
+.Op Ar
+.Nm unpigz
+.Op Fl cfhiKkLlNnqRrTtz
+.Op Fl b Ar blocksize
+.Op Fl p Ar threads
+.Op Fl S Ar suffix
+.Op Ar
+.Sh DESCRIPTION
+.Nm
 compresses using threads to make use of multiple processors and cores.
 The input is broken up into 128 KB chunks with each compressed in parallel.
 The individual check value for each chunk is also calculated in parallel.
 The compressed data is written in order to the output, and a combined check
 value is calculated from the individual check values.
-.PP
+.Pp
 The compressed data format generated is in the gzip, zlib, or single-entry
 zip format using the deflate compression method.  The compression produces
 partial raw deflate streams which are concatenated by a single write thread
 and wrapped with the appropriate header and trailer, where the trailer
 contains the combined check value.
-.PP
+.Pp
 Each partial raw deflate stream is terminated by an empty stored block
-(using the Z_SYNC_FLUSH option of zlib), in order to end that partial bit
-stream at a byte boundary.  That allows the partial streams to be
-concatenated simply as sequences of bytes.  This adds a very small four to
-five byte overhead to the output for each input chunk.
-.PP
+(using the
+.Dv Z_SYNC_FLUSH
+option of
+.Xr zlib 3 ) ,
+in order to end that partial bit stream at a byte boundary.
+That allows the partial streams to be concatenated simply as sequences
+of bytes.
+This adds a very small four to five byte overhead to the output for
+each input chunk.
+.Pp
 The default input block size is 128K, but can be changed with the
-.B -b
-option.  The number of compress threads is set by default to the number
-of online processors,
-which can be changed using the 
-.B -p
-option.  Specifying
-.B -p 1
+.Fl b
+option.
+The number of compress threads is set by default to the number
+of online processors, which can be changed using the 
+.Fl p
+option.
+Specifying
+.Fl p Ar 1
 avoids the use of threads entirely.
-.PP
+.Pp
 The input blocks, while compressed independently, have the last 32K of the
 previous block loaded as a preset dictionary to preserve the compression
-effectiveness of deflating in a single thread.  This can be turned off using
-the
-.B -i
+effectiveness of deflating in a single thread.
+This can be turned off using the
+.Fl i
 or
-.B --independent
+.Fl Fl independent
 option, so that the blocks can be decompressed
 independently for partial error recovery or for random access.
-.PP
+.Pp
 Decompression can't be parallelized, at least not without specially prepared
-deflate streams for that purpose.  As a result,
-.I pigz
-uses a single thread
-(the main thread) for decompression, but will create three other threads for
-reading, writing, and check calculation, which can speed up decompression
-under some circumstances.  Parallel decompression can be turned off by
-specifying one process 
-(
-.B -dp 1
+deflate streams for that purpose.
+As a result,
+.Nm
+uses a single thread (the main thread) for decompression, but will
+create three other threads for reading, writing, and check
+calculation, which can speed up decompression under some
+circumstances.
+Parallel decompression can be turned off by specifying one process
+.Fl ( dp Ar 1
 or
-.B -tp 1
-).
-.PP
+.Fl tp Ar 1 ) .
+.Pp
 Compressed files can be restored to their original form using
-.I pigz -d
+.Nm pigz Fl d
 or
-.I unpigz.
-
-.SH OPTIONS
-.TP
-.B -# --fast --best
+.Nm unpigz .
+.Sh OPTIONS
+.Bl -tag -width XXiXXXindependentXX
+.It Fl #, Fl Fl fast, Fl Fl best
 Regulate the speed of compression using the specified digit
-.IR # ,
+.Ar # ,
 where
-.B \-1
+.Fl 1
 or
-.B \-\-fast
+.Fl Fl fast
 indicates the fastest compression 

CVS commit: src/external/zlib/pigz/dist

2010-06-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jun 17 06:05:09 UTC 2010

Update of /cvsroot/src/external/zlib/pigz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv10092

Log Message:
(once again in the right place)

initial import of pigz 2.1.6 sources.

from http://www.zlib.net/pigz/:

pigz, which stands for parallel implementation of gzip, is a fully functional 
replacement for gzip that exploits multiple processors and multiple cores to the
hilt when compressing data. pigz was written by Mark Adler, and uses the zlib 
and pthread libraries.

How is it pronounced?
I'm glad you asked. It is pronounced pig-zee. It is not pronounced like the 
plural of pig.


once i am done adding bz2 support to pigz, i plan to obsolete my usr.bin/gzip.

Status:

Vendor Tag: adler
Release Tags:   pigz-2-1-6

N src/external/zlib/pigz/dist/pigz.spec
N src/external/zlib/pigz/dist/Makefile
N src/external/zlib/pigz/dist/pigz.1
N src/external/zlib/pigz/dist/pigz.c
N src/external/zlib/pigz/dist/pigz.pdf
N src/external/zlib/pigz/dist/pigz.ps
N src/external/zlib/pigz/dist/README
N src/external/zlib/pigz/dist/yarn.c
N src/external/zlib/pigz/dist/yarn.h

No conflicts created by this import