mirror of
https://github.com/meizu-m86/twrp_multirom_m86
synced 2025-11-04 06:15:41 +08:00
Update pigz to 2.2.5 source code
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
CFLAGS=-O3
|
||||
CC=cc
|
||||
CFLAGS=-O3 -Wall -Wextra
|
||||
|
||||
pigz: pigz.o yarn.o
|
||||
cc -o pigz pigz.o yarn.o -lpthread -lz
|
||||
$(CC) -o pigz pigz.o yarn.o -lpthread -lz
|
||||
ln -f pigz unpigz
|
||||
|
||||
pigz.o: pigz.c yarn.h
|
||||
@@ -11,19 +12,19 @@ yarn.o: yarn.c yarn.h
|
||||
dev: pigz pigzt pigzn
|
||||
|
||||
pigzt: pigzt.o yarnt.o
|
||||
cc -o pigzt pigzt.o yarnt.o -lpthread -lz
|
||||
$(CC) -o pigzt pigzt.o yarnt.o -lpthread -lz
|
||||
|
||||
pigzt.o: pigz.c yarn.h
|
||||
cc -Wall -O3 -DDEBUG -g -c -o pigzt.o pigz.c
|
||||
$(CC) -Wall -O3 -DDEBUG -g -c -o pigzt.o pigz.c
|
||||
|
||||
yarnt.o: yarn.c yarn.h
|
||||
cc -Wall -O3 -DDEBUG -g -c -o yarnt.o yarn.c
|
||||
$(CC) -Wall -O3 -DDEBUG -g -c -o yarnt.o yarn.c
|
||||
|
||||
pigzn: pigzn.o
|
||||
cc -o pigzn pigzn.o -lz
|
||||
$(CC) -o pigzn pigzn.o -lz
|
||||
|
||||
pigzn.o: pigz.c
|
||||
cc -Wall -O3 -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
|
||||
$(CC) -Wall -O3 -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
|
||||
|
||||
test: pigz
|
||||
./pigz -kf pigz.c ; ./pigz -t pigz.c.gz
|
||||
@@ -31,12 +32,22 @@ test: pigz
|
||||
./pigz -kfp 1 pigz.c ; ./pigz -t pigz.c.gz
|
||||
./pigz -kfz pigz.c ; ./pigz -t pigz.c.zz
|
||||
./pigz -kfK pigz.c ; ./pigz -t pigz.c.zip
|
||||
compress -f < pigz.c | ./unpigz | cmp - pigz.c
|
||||
rm -f pigz.c.gz pigz.c.zz pigz.c.zip
|
||||
printf "" | ./pigz -cdf | wc -c | test `cat` -eq 0
|
||||
printf "x" | ./pigz -cdf | wc -c | test `cat` -eq 1
|
||||
printf "xy" | ./pigz -cdf | wc -c | test `cat` -eq 2
|
||||
printf "xyz" | ./pigz -cdf | wc -c | test `cat` -eq 3
|
||||
(printf "w" | gzip ; printf "x") | ./pigz -cdf | wc -c | test `cat` -eq 2
|
||||
(printf "w" | gzip ; printf "xy") | ./pigz -cdf | wc -c | test `cat` -eq 3
|
||||
(printf "w" | gzip ; printf "xyz") | ./pigz -cdf | wc -c | test `cat` -eq 4
|
||||
-@if test "`whereis compress | grep /`" != ""; then \
|
||||
echo 'compress -f < pigz.c | ./unpigz | cmp - pigz.c' ;\
|
||||
compress -f < pigz.c | ./unpigz | cmp - pigz.c ;\
|
||||
fi
|
||||
@rm -f pigz.c.gz pigz.c.zz pigz.c.zip
|
||||
|
||||
tests: dev test
|
||||
./pigzn -kf pigz.c ; ./pigz -t pigz.c.gz
|
||||
rm -f pigz.c.gz
|
||||
@rm -f pigz.c.gz
|
||||
|
||||
docs: pigz.pdf
|
||||
|
||||
@@ -44,4 +55,4 @@ pigz.pdf: pigz.1
|
||||
groff -mandoc -f H -T ps pigz.1 | ps2pdf - pigz.pdf
|
||||
|
||||
clean:
|
||||
rm -f *.o pigz unpigz pigzn pigzt pigz.c.gz pigz.c.zz pigz.c.zip
|
||||
@rm -f *.o pigz unpigz pigzn pigzt pigz.c.gz pigz.c.zz pigz.c.zip
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
pigz 2.1.6 (17 Jan 2010) by Mark Adler
|
||||
pigz 2.2.5 (xx Apr 2012) by Mark Adler
|
||||
|
||||
pigz, which stands for Parallel Implementation of GZip, is a fully functional
|
||||
replacement for gzip that exploits multiple processors and multiple cores to
|
||||
|
||||
12
pigz/pigz.1
12
pigz/pigz.1
@@ -63,7 +63,7 @@ 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
|
||||
which can be changed using the
|
||||
.B -p
|
||||
option. Specifying
|
||||
.B -p 1
|
||||
@@ -86,7 +86,7 @@ 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
|
||||
specifying one process
|
||||
(
|
||||
.B -dp 1
|
||||
or
|
||||
@@ -162,6 +162,9 @@ Print no messages, even on error.
|
||||
.B -r --recursive
|
||||
Process the contents of all subdirectories.
|
||||
.TP
|
||||
.B -R --rsyncable
|
||||
Input-determined block locations for rsync.
|
||||
.TP
|
||||
.B -S --suffix .sss
|
||||
Use suffix .sss instead of .gz (for compression).
|
||||
.TP
|
||||
@@ -179,9 +182,12 @@ Show the version of pigz.
|
||||
.TP
|
||||
.B -z --zlib
|
||||
Compress to zlib (.zz) instead of gzip format.
|
||||
.TP
|
||||
.B --
|
||||
All arguments after "--" are treated as file names (for names that start with "-")
|
||||
.SH "COPYRIGHT NOTICE"
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
arising from the use of this software.
|
||||
.PP
|
||||
Copyright (C) 2007, 2008, 2009, 2010 Mark Adler <madler@alumni.caltech.edu>
|
||||
Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Mark Adler <madler@alumni.caltech.edu>
|
||||
|
||||
1044
pigz/pigz.c
1044
pigz/pigz.c
File diff suppressed because it is too large
Load Diff
BIN
pigz/pigz.pdf
Normal file
BIN
pigz/pigz.pdf
Normal file
Binary file not shown.
@@ -1,26 +1,33 @@
|
||||
Summary: pigz is a parallel implementation of gzip which utilizes multiple cores
|
||||
Name: pigz
|
||||
Version: 2.1.6
|
||||
Release: 1
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
License: GPL
|
||||
Group: Applications/Tools
|
||||
Packager: Duncan Brown <duncan@duncanbrown.org>
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
URL: http://www.zlib.net/pigz
|
||||
|
||||
%description
|
||||
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.
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%prep
|
||||
mkdir -p $RPM_BUILD_ROOT
|
||||
%setup -q
|
||||
%build
|
||||
make
|
||||
mkdir -p ${RPM_BUILD_ROOT}/usr/bin
|
||||
mv pigz ${RPM_BUILD_ROOT}/usr/bin
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
/usr/bin/pigz
|
||||
Summary: pigz is a parallel implementation of gzip which utilizes multiple cores
|
||||
Name: pigz
|
||||
Version: 2.2.5
|
||||
Release: 1
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
License: zlib
|
||||
Group: Applications/Tools
|
||||
Packager: Duncan Brown <duncan@duncanbrown.org>
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
URL: http://www.zlib.net/pigz
|
||||
|
||||
%description
|
||||
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.
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%prep
|
||||
mkdir -p $RPM_BUILD_ROOT
|
||||
|
||||
%setup -q
|
||||
%build
|
||||
make
|
||||
mkdir -p ${RPM_BUILD_ROOT}/usr/bin
|
||||
mkdir -p ${RPM_BUILD_ROOT}/usr/man/man1
|
||||
mv pigz unpigz ${RPM_BUILD_ROOT}/usr/bin
|
||||
mv pigz.1 ${RPM_BUILD_ROOT}/usr/man/man1
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
/usr/bin/pigz
|
||||
/usr/bin/unpigz
|
||||
%doc
|
||||
/usr/man/man1/pigz.1
|
||||
|
||||
18
pigz/yarn.c
18
pigz/yarn.c
@@ -1,6 +1,6 @@
|
||||
/* yarn.c -- generic thread operations implemented using pthread functions
|
||||
* Copyright (C) 2008 Mark Adler
|
||||
* Version 1.1 26 Oct 2008 Mark Adler
|
||||
* Copyright (C) 2008, 2012 Mark Adler
|
||||
* Version 1.3 13 Jan 2012 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in yarn.h
|
||||
*/
|
||||
|
||||
@@ -13,11 +13,19 @@
|
||||
1.0 19 Oct 2008 First version
|
||||
1.1 26 Oct 2008 No need to set the stack size -- remove
|
||||
Add yarn_abort() function for clean-up on error exit
|
||||
1.2 19 Dec 2011 (changes reversed in 1.3)
|
||||
1.3 13 Jan 2012 Add large file #define for consistency with pigz.c
|
||||
Update thread portability #defines per IEEE 1003.1-2008
|
||||
Fix documentation in yarn.h for yarn_prefix
|
||||
*/
|
||||
|
||||
/* for thread portability */
|
||||
#define _POSIX_PTHREAD_SEMANTICS
|
||||
#define _REENTRANT
|
||||
#define _XOPEN_SOURCE 700
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#define _THREAD_SAFE
|
||||
|
||||
/* use large file functions if available */
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* external libraries and entities referenced */
|
||||
#include <stdio.h> /* fprintf(), stderr */
|
||||
@@ -199,6 +207,8 @@ local void reenter(void *dummy)
|
||||
thread *match, **prior;
|
||||
pthread_t me;
|
||||
|
||||
(void)dummy;
|
||||
|
||||
/* find this thread in the threads list by matching the thread id */
|
||||
me = pthread_self();
|
||||
possess(&(threads_lock));
|
||||
|
||||
10
pigz/yarn.h
10
pigz/yarn.h
@@ -1,6 +1,6 @@
|
||||
/* yarn.h -- generic interface for thread operations
|
||||
* Copyright (C) 2008 Mark Adler
|
||||
* Version 1.1 26 Oct 2008 Mark Adler
|
||||
* Copyright (C) 2008, 2011 Mark Adler
|
||||
* Version 1.3 13 Jan 2012 Mark Adler
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -100,9 +100,9 @@
|
||||
|
||||
-- Error control --
|
||||
|
||||
yarn_name - a char pointer to a string that will be the prefix for any error
|
||||
messages that these routines generate before exiting -- if not changed
|
||||
by the application, "yarn" will be used
|
||||
yarn_prefix - a char pointer to a string that will be the prefix for any
|
||||
error messages that these routines generate before exiting -- if not
|
||||
changed by the application, "yarn" will be used
|
||||
yarn_abort - an external function that will be executed when there is an
|
||||
internal yarn error, due to out of memory or misuse -- this function
|
||||
may exit to abort the application, or if it returns, the yarn error
|
||||
|
||||
Reference in New Issue
Block a user