1
0
Fork 0

Adding upstream version 1.4~rc2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-23 19:16:35 +01:00
parent d1ff0bc793
commit b44f925128
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
6 changed files with 43 additions and 20 deletions

View file

@ -1,3 +1,10 @@
2013-04-15 Antonio Diaz Diaz <ant_diaz@teleline.es>
* Version 1.4-rc2 released.
* Fixed return value of '-d' and '-t' in case of data error.
* main.c: Changed info shown at verbosity levels 2 and 3.
* Ignore option '-n, --threads' for compatibility with plzip.
2013-02-18 Antonio Diaz Diaz <ant_diaz@teleline.es> 2013-02-18 Antonio Diaz Diaz <ant_diaz@teleline.es>
* Version 1.4-rc1 released. * Version 1.4-rc1 released.

View file

@ -1,7 +1,7 @@
Requirements Requirements
------------ ------------
You will need a C compiler. You will need a C compiler.
I use gcc 4.7.2 and 3.3.6, but the code should compile with any I use gcc 4.8.0 and 3.3.6, but the code should compile with any
standards compliant compiler. standards compliant compiler.
Gcc is available at http://gcc.gnu.org. Gcc is available at http://gcc.gnu.org.

9
NEWS
View file

@ -7,9 +7,16 @@ Pdlzip now accepts more than one file in the command line.
Decompression time has been reduced by 5%. Decompression time has been reduced by 5%.
The dependence of "--test" on the existence of "/dev/null" has been The dependence of "-t" on the existence of "/dev/null" has been
removed. removed.
The value returned by "-d" and "-t" in case of data error has been fixed.
Information shown at verbosity levels 2 and 3 has been changed.
Option "-n, --threads" is now accepted and ignored for compatibility
with plzip.
Configure option "--datadir" has been renamed to "--datarootdir" to Configure option "--datadir" has been renamed to "--datarootdir" to
follow GNU Standards. follow GNU Standards.

4
configure vendored
View file

@ -8,9 +8,9 @@
args= args=
no_create= no_create=
pkgname=pdlzip pkgname=pdlzip
pkgversion=1.4-rc1 pkgversion=1.4-rc2
progname=pdlzip progname=pdlzip
srctrigger=clzip.h srctrigger=doc/pdlzip.1
# clear some things potentially inherited from environment. # clear some things potentially inherited from environment.
LC_ALL=C LC_ALL=C

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
.TH PDLZIP "1" "February 2013" "Pdlzip 1.4-rc1" "User Commands" .TH PDLZIP "1" "April 2013" "Pdlzip 1.4-rc2" "User Commands"
.SH NAME .SH NAME
Pdlzip \- reduces the size of files Pdlzip \- reduces the size of files
.SH SYNOPSIS .SH SYNOPSIS
@ -66,6 +66,11 @@ The bidimensional parameter space of LZMA can't be mapped to a linear
scale optimal for all files. If your files are large, very repetitive, scale optimal for all files. If your files are large, very repetitive,
etc, you may need to use the \fB\-\-match\-length\fR and \fB\-\-dictionary\-size\fR etc, you may need to use the \fB\-\-match\-length\fR and \fB\-\-dictionary\-size\fR
options directly to achieve optimal performance. options directly to achieve optimal performance.
.PP
Return values: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
invalid input file, 3 for an internal consistency error (eg, bug) which
caused pdlzip to panic.
.SH "REPORTING BUGS" .SH "REPORTING BUGS"
Report bugs to lzip\-bug@nongnu.org Report bugs to lzip\-bug@nongnu.org
.br .br

34
main.c
View file

@ -118,6 +118,10 @@ static void show_help( void )
"scale optimal for all files. If your files are large, very repetitive,\n" "scale optimal for all files. If your files are large, very repetitive,\n"
"etc, you may need to use the --match-length and --dictionary-size\n" "etc, you may need to use the --match-length and --dictionary-size\n"
"options directly to achieve optimal performance.\n" "options directly to achieve optimal performance.\n"
"\nReturn values: 0 for a normal exit, 1 for environmental problems (file\n"
"not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or\n"
"invalid input file, 3 for an internal consistency error (eg, bug) which\n"
"caused pdlzip to panic.\n"
"\nReport bugs to lzip-bug@nongnu.org\n" "\nReport bugs to lzip-bug@nongnu.org\n"
"Pdlzip home page: http://www.nongnu.org/lzip/pdlzip.html\n" ); "Pdlzip home page: http://www.nongnu.org/lzip/pdlzip.html\n" );
} }
@ -163,8 +167,9 @@ void show_header( const File_header header )
for( i = 0; i < 8 && ( num > 9999 || ( exact && num >= factor ) ); ++i ) for( i = 0; i < 8 && ( num > 9999 || ( exact && num >= factor ) ); ++i )
{ num /= factor; if( num % factor != 0 ) exact = false; { num /= factor; if( num % factor != 0 ) exact = false;
p = prefix[i]; np = ""; } p = prefix[i]; np = ""; }
fprintf( stderr, "version %d, dictionary size %s%4u %sB. ", if( verbosity >= 4 )
Fh_version( header ), np, num, p ); fprintf( stderr, "version %d, ", Fh_version( header ) );
fprintf( stderr, "dictionary size %s%4u %sB. ", np, num, p );
} }
@ -502,7 +507,7 @@ static int lzma_decode( uint64_t unpackSize, CLzmaDec *decoder, const int infd,
if( !LzmaDec_DecodeToBuf( decoder, outBuf + outPos, &outProcessed, if( !LzmaDec_DecodeToBuf( decoder, outBuf + outPos, &outProcessed,
inBuf + *inPos, &inProcessed, finishMode, &status ) ) inBuf + *inPos, &inProcessed, finishMode, &status ) )
{ show_error( "Data error.", 0, false ); return 1; } { show_error( "Data error.", 0, false ); return 2; }
*inPos += inProcessed; *inPos += inProcessed;
total_in += inProcessed; total_in += inProcessed;
outPos += outProcessed; outPos += outProcessed;
@ -519,7 +524,7 @@ static int lzma_decode( uint64_t unpackSize, CLzmaDec *decoder, const int infd,
{ {
if( ( thereIsSize && unpackSize != 0 ) || if( ( thereIsSize && unpackSize != 0 ) ||
( !thereIsSize && status != LZMA_STATUS_FINISHED_WITH_MARK ) ) ( !thereIsSize && status != LZMA_STATUS_FINISHED_WITH_MARK ) )
{ show_error( "Data error.", 0, false ); return 1; } { show_error( "Data error.", 0, false ); return 2; }
if( verbosity >= 2 ) if( verbosity >= 2 )
fprintf( stderr, "lzma-alone, dictionary size %7sB. ", fprintf( stderr, "lzma-alone, dictionary size %7sB. ",
format_num( decoder->dicBufSize ) ); format_num( decoder->dicBufSize ) );
@ -527,8 +532,7 @@ static int lzma_decode( uint64_t unpackSize, CLzmaDec *decoder, const int infd,
fprintf( stderr, "uncompressed size %9llu, compressed size %8llu. ", fprintf( stderr, "uncompressed size %9llu, compressed size %8llu. ",
total_out, total_in ); total_out, total_in );
if( verbosity >= 1 ) if( verbosity >= 1 )
{ if( testing ) fprintf( stderr, "(apparently) ok\n" ); fprintf( stderr, testing ? "(apparently) ok\n" : "(apparently) done\n" );
else fprintf( stderr, "(apparently) done\n" ); }
return 0; return 0;
} }
} }
@ -554,12 +558,12 @@ static int lzip_decode( CLzmaDec *decoder, const int infd, uint8_t inBuf[],
if( *inPos >= *inSize && !read_inbuf( infd, inBuf, inPos, inSize ) ) if( *inPos >= *inSize && !read_inbuf( infd, inBuf, inPos, inSize ) )
return 1; return 1;
if( *inPos >= *inSize ) if( *inPos >= *inSize )
{ show_error( "Unexpected EOF.", 0, false ); return 1; } { show_error( "Unexpected EOF.", 0, false ); return 2; }
inProcessed = *inSize - *inPos; inProcessed = *inSize - *inPos;
if( !LzmaDec_DecodeToBuf( decoder, outBuf + outPos, &outProcessed, if( !LzmaDec_DecodeToBuf( decoder, outBuf + outPos, &outProcessed,
inBuf + *inPos, &inProcessed, finishMode, &status ) ) inBuf + *inPos, &inProcessed, finishMode, &status ) )
{ show_error( "Data error.", 0, false ); return 1; } { show_error( "Data error.", 0, false ); return 2; }
*inPos += inProcessed; *inPos += inProcessed;
total_in += inProcessed; total_in += inProcessed;
outPos += outProcessed; outPos += outProcessed;
@ -579,7 +583,7 @@ static int lzip_decode( CLzmaDec *decoder, const int infd, uint8_t inBuf[],
bool error = false; bool error = false;
if( status != LZMA_STATUS_FINISHED_WITH_MARK ) if( status != LZMA_STATUS_FINISHED_WITH_MARK )
{ show_error( "Data error.", 0, false ); return 1; } { show_error( "Data error.", 0, false ); return 2; }
if( *inSize - *inPos < trailer_size && if( *inSize - *inPos < trailer_size &&
!read_inbuf( infd, inBuf, inPos, inSize ) ) return 1; !read_inbuf( infd, inBuf, inPos, inSize ) ) return 1;
if( *inSize - *inPos < trailer_size ) if( *inSize - *inPos < trailer_size )
@ -617,7 +621,7 @@ static int lzip_decode( CLzmaDec *decoder, const int infd, uint8_t inBuf[],
fprintf( stderr, "Member size mismatch; trailer says %llu, member size is %llu (0x%llX).\n", fprintf( stderr, "Member size mismatch; trailer says %llu, member size is %llu (0x%llX).\n",
Ft_get_member_size( trailer ), total_in, total_in ); Ft_get_member_size( trailer ), total_in, total_in );
} }
if( !error && verbosity >= 3 && total_out > 0 && total_in > 0 ) if( !error && verbosity >= 2 && total_out > 0 && total_in > 0 )
fprintf( stderr, "%6.3f:1, %6.3f bits/byte, %5.2f%% saved. ", fprintf( stderr, "%6.3f:1, %6.3f bits/byte, %5.2f%% saved. ",
(double)total_out / total_in, (double)total_out / total_in,
( 8.0 * total_in ) / total_out, ( 8.0 * total_in ) / total_out,
@ -701,7 +705,7 @@ static int decompress( const int infd, struct Pretty_print * const pp,
if( verbosity >= 2 || ( verbosity == 1 && first_member ) ) if( verbosity >= 2 || ( verbosity == 1 && first_member ) )
{ {
Pp_show_msg( pp, 0 ); Pp_show_msg( pp, 0 );
if( lzip_mode && verbosity >= 2 ) show_header( header ); if( lzip_mode && verbosity >= 3 ) show_header( header );
} }
if( !LzmaDec_Init( &decoder, raw_props ) ) if( !LzmaDec_Init( &decoder, raw_props ) )
@ -718,12 +722,10 @@ static int decompress( const int infd, struct Pretty_print * const pp,
LzmaDec_Free(&decoder); LzmaDec_Free(&decoder);
if( retval != 0 || !lzip_mode ) break; if( retval != 0 || !lzip_mode ) break;
if( verbosity >= 2 ) if( verbosity >= 2 )
{ if( testing ) fprintf( stderr, "ok\n" ); { fprintf( stderr, testing ? "ok\n" : "done\n" ); Pp_reset( pp ); }
else fprintf( stderr, "done\n" ); Pp_reset( pp ); }
} }
if( lzip_mode && verbosity == 1 && retval == 0 ) if( lzip_mode && verbosity == 1 && retval == 0 )
{ if( testing ) fprintf( stderr, "ok\n" ); fprintf( stderr, testing ? "ok\n" : "done\n" );
else fprintf( stderr, "done\n" ); }
return retval; return retval;
} }
@ -862,6 +864,7 @@ int main( const int argc, const char * const argv[] )
{ 'h', "help", ap_no }, { 'h', "help", ap_no },
{ 'k', "keep", ap_no }, { 'k', "keep", ap_no },
{ 'm', "match-length", ap_yes }, { 'm', "match-length", ap_yes },
{ 'n', "threads", ap_yes },
{ 'o', "output", ap_yes }, { 'o', "output", ap_yes },
{ 'q', "quiet", ap_no }, { 'q', "quiet", ap_no },
{ 's', "dictionary-size", ap_yes }, { 's', "dictionary-size", ap_yes },
@ -901,6 +904,7 @@ int main( const int argc, const char * const argv[] )
case 'k': keep_input_files = true; break; case 'k': keep_input_files = true; break;
case 'm': encoder_options.match_len_limit = case 'm': encoder_options.match_len_limit =
getnum( arg, min_match_len_limit, max_match_len ); break; getnum( arg, min_match_len_limit, max_match_len ); break;
case 'n': break;
case 'o': default_output_filename = arg; break; case 'o': default_output_filename = arg; break;
case 'q': verbosity = -1; break; case 'q': verbosity = -1; break;
case 's': encoder_options.dictionary_size = get_dict_size( arg ); case 's': encoder_options.dictionary_size = get_dict_size( arg );