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
 | 
					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
 | 
						ln -f pigz unpigz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pigz.o: pigz.c yarn.h
 | 
					pigz.o: pigz.c yarn.h
 | 
				
			||||||
@@ -11,19 +12,19 @@ yarn.o: yarn.c yarn.h
 | 
				
			|||||||
dev: pigz pigzt pigzn
 | 
					dev: pigz pigzt pigzn
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pigzt: pigzt.o yarnt.o
 | 
					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
 | 
					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
 | 
					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
 | 
					pigzn: pigzn.o
 | 
				
			||||||
	cc -o pigzn pigzn.o -lz
 | 
						$(CC) -o pigzn pigzn.o -lz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pigzn.o: pigz.c
 | 
					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
 | 
					test: pigz
 | 
				
			||||||
	./pigz -kf pigz.c ; ./pigz -t pigz.c.gz
 | 
						./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 -kfp 1 pigz.c ; ./pigz -t pigz.c.gz
 | 
				
			||||||
	./pigz -kfz pigz.c ; ./pigz -t pigz.c.zz
 | 
						./pigz -kfz pigz.c ; ./pigz -t pigz.c.zz
 | 
				
			||||||
	./pigz -kfK pigz.c ; ./pigz -t pigz.c.zip
 | 
						./pigz -kfK pigz.c ; ./pigz -t pigz.c.zip
 | 
				
			||||||
	compress -f < pigz.c | ./unpigz | cmp - pigz.c
 | 
						printf "" | ./pigz -cdf | wc -c | test `cat` -eq 0
 | 
				
			||||||
	rm -f pigz.c.gz pigz.c.zz pigz.c.zip
 | 
						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
 | 
					tests: dev test
 | 
				
			||||||
	./pigzn -kf pigz.c ; ./pigz -t pigz.c.gz
 | 
						./pigzn -kf pigz.c ; ./pigz -t pigz.c.gz
 | 
				
			||||||
	rm -f pigz.c.gz
 | 
						@rm -f pigz.c.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
docs: pigz.pdf
 | 
					docs: pigz.pdf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -44,4 +55,4 @@ pigz.pdf: pigz.1
 | 
				
			|||||||
	groff -mandoc -f H -T ps pigz.1 | ps2pdf - pigz.pdf
 | 
						groff -mandoc -f H -T ps pigz.1 | ps2pdf - pigz.pdf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
clean:
 | 
					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
 | 
					pigz, which stands for Parallel Implementation of GZip, is a fully functional
 | 
				
			||||||
replacement for gzip that exploits multiple processors and multiple cores to
 | 
					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
 | 
					.B -b
 | 
				
			||||||
option.  The number of compress threads is set by default to the number
 | 
					option.  The number of compress threads is set by default to the number
 | 
				
			||||||
of online processors,
 | 
					of online processors,
 | 
				
			||||||
which can be changed using the 
 | 
					which can be changed using the
 | 
				
			||||||
.B -p
 | 
					.B -p
 | 
				
			||||||
option.  Specifying
 | 
					option.  Specifying
 | 
				
			||||||
.B -p 1
 | 
					.B -p 1
 | 
				
			||||||
@@ -86,7 +86,7 @@ uses a single thread
 | 
				
			|||||||
(the main thread) for decompression, but will create three other threads for
 | 
					(the main thread) for decompression, but will create three other threads for
 | 
				
			||||||
reading, writing, and check calculation, which can speed up decompression
 | 
					reading, writing, and check calculation, which can speed up decompression
 | 
				
			||||||
under some circumstances.  Parallel decompression can be turned off by
 | 
					under some circumstances.  Parallel decompression can be turned off by
 | 
				
			||||||
specifying one process 
 | 
					specifying one process
 | 
				
			||||||
(
 | 
					(
 | 
				
			||||||
.B -dp 1
 | 
					.B -dp 1
 | 
				
			||||||
or
 | 
					or
 | 
				
			||||||
@@ -162,6 +162,9 @@ Print no messages, even on error.
 | 
				
			|||||||
.B -r --recursive
 | 
					.B -r --recursive
 | 
				
			||||||
Process the contents of all subdirectories.
 | 
					Process the contents of all subdirectories.
 | 
				
			||||||
.TP
 | 
					.TP
 | 
				
			||||||
 | 
					.B -R --rsyncable
 | 
				
			||||||
 | 
					Input-determined block locations for rsync.
 | 
				
			||||||
 | 
					.TP
 | 
				
			||||||
.B -S --suffix .sss
 | 
					.B -S --suffix .sss
 | 
				
			||||||
Use suffix .sss instead of .gz (for compression).
 | 
					Use suffix .sss instead of .gz (for compression).
 | 
				
			||||||
.TP
 | 
					.TP
 | 
				
			||||||
@@ -179,9 +182,12 @@ Show the version of pigz.
 | 
				
			|||||||
.TP
 | 
					.TP
 | 
				
			||||||
.B -z --zlib
 | 
					.B -z --zlib
 | 
				
			||||||
Compress to zlib (.zz) instead of gzip format.
 | 
					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"
 | 
					.SH "COPYRIGHT NOTICE"
 | 
				
			||||||
This software is provided 'as-is', without any express or implied
 | 
					This software is provided 'as-is', without any express or implied
 | 
				
			||||||
warranty.  In no event will the author be held liable for any damages
 | 
					warranty.  In no event will the author be held liable for any damages
 | 
				
			||||||
arising from the use of this software.
 | 
					arising from the use of this software.
 | 
				
			||||||
.PP
 | 
					.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
 | 
					Summary: pigz is a parallel implementation of gzip which utilizes multiple cores
 | 
				
			||||||
Name: pigz
 | 
					Name: pigz
 | 
				
			||||||
Version: 2.1.6
 | 
					Version: 2.2.5
 | 
				
			||||||
Release: 1
 | 
					Release: 1
 | 
				
			||||||
Source0: %{name}-%{version}.tar.gz
 | 
					Source0: %{name}-%{version}.tar.gz
 | 
				
			||||||
License: GPL
 | 
					License: zlib
 | 
				
			||||||
Group: Applications/Tools
 | 
					Group: Applications/Tools
 | 
				
			||||||
Packager: Duncan Brown <duncan@duncanbrown.org>
 | 
					Packager: Duncan Brown <duncan@duncanbrown.org>
 | 
				
			||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 | 
					BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 | 
				
			||||||
URL: http://www.zlib.net/pigz
 | 
					URL: http://www.zlib.net/pigz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%description
 | 
					%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.
 | 
					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
 | 
					%clean
 | 
				
			||||||
rm -rf $RPM_BUILD_ROOT
 | 
					rm -rf $RPM_BUILD_ROOT
 | 
				
			||||||
%prep
 | 
					%prep
 | 
				
			||||||
mkdir -p $RPM_BUILD_ROOT
 | 
					mkdir -p $RPM_BUILD_ROOT
 | 
				
			||||||
%setup -q
 | 
					
 | 
				
			||||||
%build
 | 
					%setup -q
 | 
				
			||||||
make
 | 
					%build
 | 
				
			||||||
mkdir -p ${RPM_BUILD_ROOT}/usr/bin
 | 
					make
 | 
				
			||||||
mv pigz ${RPM_BUILD_ROOT}/usr/bin
 | 
					mkdir -p ${RPM_BUILD_ROOT}/usr/bin
 | 
				
			||||||
%files
 | 
					mkdir -p ${RPM_BUILD_ROOT}/usr/man/man1
 | 
				
			||||||
%defattr(-,root,root)
 | 
					mv pigz unpigz ${RPM_BUILD_ROOT}/usr/bin
 | 
				
			||||||
/usr/bin/pigz
 | 
					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
 | 
					/* yarn.c -- generic thread operations implemented using pthread functions
 | 
				
			||||||
 * Copyright (C) 2008 Mark Adler
 | 
					 * Copyright (C) 2008, 2012 Mark Adler
 | 
				
			||||||
 * Version 1.1  26 Oct 2008  Mark Adler
 | 
					 * Version 1.3  13 Jan 2012  Mark Adler
 | 
				
			||||||
 * For conditions of distribution and use, see copyright notice in yarn.h
 | 
					 * For conditions of distribution and use, see copyright notice in yarn.h
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -13,11 +13,19 @@
 | 
				
			|||||||
   1.0    19 Oct 2008  First version
 | 
					   1.0    19 Oct 2008  First version
 | 
				
			||||||
   1.1    26 Oct 2008  No need to set the stack size -- remove
 | 
					   1.1    26 Oct 2008  No need to set the stack size -- remove
 | 
				
			||||||
                       Add yarn_abort() function for clean-up on error exit
 | 
					                       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 */
 | 
					/* for thread portability */
 | 
				
			||||||
#define _POSIX_PTHREAD_SEMANTICS
 | 
					#define _XOPEN_SOURCE 700
 | 
				
			||||||
#define _REENTRANT
 | 
					#define _POSIX_C_SOURCE 200809L
 | 
				
			||||||
 | 
					#define _THREAD_SAFE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* use large file functions if available */
 | 
				
			||||||
 | 
					#define _FILE_OFFSET_BITS 64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* external libraries and entities referenced */
 | 
					/* external libraries and entities referenced */
 | 
				
			||||||
#include <stdio.h>      /* fprintf(), stderr */
 | 
					#include <stdio.h>      /* fprintf(), stderr */
 | 
				
			||||||
@@ -199,6 +207,8 @@ local void reenter(void *dummy)
 | 
				
			|||||||
    thread *match, **prior;
 | 
					    thread *match, **prior;
 | 
				
			||||||
    pthread_t me;
 | 
					    pthread_t me;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    (void)dummy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* find this thread in the threads list by matching the thread id */
 | 
					    /* find this thread in the threads list by matching the thread id */
 | 
				
			||||||
    me = pthread_self();
 | 
					    me = pthread_self();
 | 
				
			||||||
    possess(&(threads_lock));
 | 
					    possess(&(threads_lock));
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								pigz/yarn.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								pigz/yarn.h
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
/* yarn.h -- generic interface for thread operations
 | 
					/* yarn.h -- generic interface for thread operations
 | 
				
			||||||
 * Copyright (C) 2008 Mark Adler
 | 
					 * Copyright (C) 2008, 2011 Mark Adler
 | 
				
			||||||
 * Version 1.1  26 Oct 2008  Mark Adler
 | 
					 * Version 1.3  13 Jan 2012  Mark Adler
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
@@ -100,9 +100,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
   -- Error control --
 | 
					   -- Error control --
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   yarn_name - a char pointer to a string that will be the prefix for any error
 | 
					   yarn_prefix - a char pointer to a string that will be the prefix for any
 | 
				
			||||||
        messages that these routines generate before exiting -- if not changed
 | 
					        error messages that these routines generate before exiting -- if not
 | 
				
			||||||
        by the application, "yarn" will be used
 | 
					        changed by the application, "yarn" will be used
 | 
				
			||||||
   yarn_abort - an external function that will be executed when there is an
 | 
					   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
 | 
					        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
 | 
					        may exit to abort the application, or if it returns, the yarn error
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user