diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 7 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | doc/zcat.1 | 2 | ||||
-rw-r--r-- | doc/zcmp.1 | 2 | ||||
-rw-r--r-- | doc/zdiff.1 | 2 | ||||
-rw-r--r-- | doc/zgrep.1 | 2 | ||||
-rw-r--r-- | doc/ztest.1 | 2 | ||||
-rw-r--r-- | doc/zupdate.1 | 2 | ||||
-rw-r--r-- | doc/zutils.info | 27 | ||||
-rw-r--r-- | doc/zutils.texi | 9 | ||||
-rwxr-xr-x | testsuite/check.sh | 6 | ||||
-rw-r--r-- | ztest.cc | 13 | ||||
-rw-r--r-- | zupdate.cc | 7 |
14 files changed, 62 insertions, 27 deletions
@@ -1,3 +1,9 @@ +2014-07-18 Antonio Diaz Diaz <antonio@gnu.org> + + * Version 1.3-pre2 released. + * testsuite/check.sh: Fixed two values of expected exit status. + * zutils.texi: Documented that '--format' does not verify format. + 2014-06-28 Antonio Diaz Diaz <antonio@gnu.org> * Version 1.3-pre1 released. @@ -1,3 +1,10 @@ Changes in version 1.3: +Two incomplete values of expected exit status producing sporadic +failures of the tests have been fixed. + The license has been changed to GPL version 2 or later. + +It has been documented that the "--format" option does not verify the +format, allowing for example the processing of compress'd (.Z) files +with gzip. @@ -6,7 +6,7 @@ # to copy, distribute and modify it. pkgname=zutils -pkgversion=1.3-pre1 +pkgversion=1.3-pre2 srctrigger=doc/${pkgname}.texi # clear some things potentially inherited from environment. @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH ZCAT "1" "June 2014" "zcat (zutils) 1.3-pre1" "User Commands" +.TH ZCAT "1" "July 2014" "zcat (zutils) 1.3-pre2" "User Commands" .SH NAME zcat \- decompress and concatenate files to standard output .SH SYNOPSIS @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH ZCMP "1" "June 2014" "zcmp (zutils) 1.3-pre1" "User Commands" +.TH ZCMP "1" "July 2014" "zcmp (zutils) 1.3-pre2" "User Commands" .SH NAME zcmp \- decompress and compare two files byte by byte .SH SYNOPSIS diff --git a/doc/zdiff.1 b/doc/zdiff.1 index c035b22..146a7e3 100644 --- a/doc/zdiff.1 +++ b/doc/zdiff.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH ZDIFF "1" "June 2014" "zdiff (zutils) 1.3-pre1" "User Commands" +.TH ZDIFF "1" "July 2014" "zdiff (zutils) 1.3-pre2" "User Commands" .SH NAME zdiff \- decompress and compare two files line by line .SH SYNOPSIS diff --git a/doc/zgrep.1 b/doc/zgrep.1 index 31d79f9..203938a 100644 --- a/doc/zgrep.1 +++ b/doc/zgrep.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH ZGREP "1" "June 2014" "zgrep (zutils) 1.3-pre1" "User Commands" +.TH ZGREP "1" "July 2014" "zgrep (zutils) 1.3-pre2" "User Commands" .SH NAME zgrep \- search compressed files for a regular expression .SH SYNOPSIS diff --git a/doc/ztest.1 b/doc/ztest.1 index 5b43353..44fcbc5 100644 --- a/doc/ztest.1 +++ b/doc/ztest.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH ZTEST "1" "June 2014" "ztest (zutils) 1.3-pre1" "User Commands" +.TH ZTEST "1" "July 2014" "ztest (zutils) 1.3-pre2" "User Commands" .SH NAME ztest \- verify integrity of compressed files .SH SYNOPSIS diff --git a/doc/zupdate.1 b/doc/zupdate.1 index 08ee94e..ef23251 100644 --- a/doc/zupdate.1 +++ b/doc/zupdate.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH ZUPDATE "1" "June 2014" "zupdate (zutils) 1.3-pre1" "User Commands" +.TH ZUPDATE "1" "July 2014" "zupdate (zutils) 1.3-pre2" "User Commands" .SH NAME zupdate \- recompress bzip2, gzip, xz files to lzip files .SH SYNOPSIS diff --git a/doc/zutils.info b/doc/zutils.info index b8d66fd..7cc74aa 100644 --- a/doc/zutils.info +++ b/doc/zutils.info @@ -12,7 +12,7 @@ File: zutils.info, Node: Top, Next: Introduction, Up: (dir) Zutils Manual ************* -This manual is for Zutils (version 1.3-pre1, 28 June 2014). +This manual is for Zutils (version 1.3-pre2, 17 July 2014). * Menu: @@ -63,6 +63,11 @@ which makes them safe to use with zutils. Gzip and xz may return ambiguous warning values, making them less reliable back ends for zutils. + FORMAT NOTE: If the '--format' option is given, the corresponding +files are passed to the decompressor without verifying their format, +allowing for example the processing of compress'd (.Z) files with gzip: +'zcmp --format=gz file.Z file.lz'. + LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never have been compressed. Decompressed is used to refer to data which has undergone the process of decompression. @@ -704,16 +709,16 @@ Concept index Tag Table: Node: Top222 Node: Introduction1156 -Node: Common options3257 -Node: The zutilsrc file4506 -Node: Zcat5432 -Node: Zcmp7354 -Node: Zdiff9678 -Node: Zgrep12181 -Node: Ztest15149 -Node: Zupdate16373 -Node: Problems18761 -Node: Concept index19295 +Node: Common options3503 +Node: The zutilsrc file4752 +Node: Zcat5678 +Node: Zcmp7600 +Node: Zdiff9924 +Node: Zgrep12427 +Node: Ztest15395 +Node: Zupdate16619 +Node: Problems19007 +Node: Concept index19541 End Tag Table diff --git a/doc/zutils.texi b/doc/zutils.texi index 198fb20..f09e5e9 100644 --- a/doc/zutils.texi +++ b/doc/zutils.texi @@ -6,8 +6,8 @@ @finalout @c %**end of header -@set UPDATED 28 June 2014 -@set VERSION 1.3-pre1 +@set UPDATED 17 July 2014 +@set VERSION 1.3-pre2 @dircategory Data Compression @direntry @@ -83,6 +83,11 @@ NOTE: Bzip2 and lzip provide well-defined values of exit status, which makes them safe to use with zutils. Gzip and xz may return ambiguous warning values, making them less reliable back ends for zutils. +FORMAT NOTE: If the @samp{--format} option is given, the corresponding +files are passed to the decompressor without verifying their format, +allowing for example the processing of compress'd (.Z) files with gzip: +@samp{zcmp --format=gz file.Z file.lz}. + LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never have been compressed. Decompressed is used to refer to data which has undergone the process of decompression. diff --git a/testsuite/check.sh b/testsuite/check.sh index 2dc013f..1cf52a2 100755 --- a/testsuite/check.sh +++ b/testsuite/check.sh @@ -168,7 +168,8 @@ printf . "${ZCMP}" -N -q --format=lz in.lz if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi "${ZCMP}" -N --format=lz in.gz in.lz 2> /dev/null -if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi +res=$? +if [ ${res} = 1 ] || [ ${res} = 2 ] ; then printf . ; else printf - ; fail=1 ; fi "${ZCMP}" -N -n -1 in in 2> /dev/null if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi "${ZCMP}" -N --bad-option in in 2> /dev/null @@ -233,7 +234,8 @@ printf . "${ZDIFF}" -N -q --format=bz2 in.bz2 2> /dev/null if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi "${ZDIFF}" -N -q --format=,lz in.lz in.bz2 > /dev/null 2>&1 -if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi +res=$? +if [ ${res} = 1 ] || [ ${res} = 2 ] ; then printf . ; else printf - ; fail=1 ; fi "${ZDIFF}" -N --bad-option 2> /dev/null if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi @@ -152,13 +152,24 @@ int ztest_file( const int infd, int format_index, const std::string & input_filename, const std::vector< const char * > & ztest_args ) { + static int disable_xz = -1; // tri-state bool const uint8_t * magic_data = 0; int magic_size = 0; if( format_index < 0 ) format_index = test_format( infd, &magic_data, &magic_size ); const char * const compressor_name = get_compressor_name( format_index ); if( !compressor_name ) - return 0; // skip this file + return 0; // ignore this file + if( format_index == fmt_xz ) + { + if( disable_xz < 0 ) + { + std::string command( compressor_name ); command += " -V > /dev/null"; + disable_xz = ( std::system( command.c_str() ) != 0 ); + } + if( disable_xz ) return 0; // ignore this file if no xz installed + } + const pid_t pid = fork(); if( pid == 0 ) // child (compressor) @@ -136,14 +136,13 @@ struct { const char * from; const char * to; int format_index; } const { ".txz", ".tar", fmt_xz }, { 0, 0, -1 } }; -int disable_xz = -1; // tri-state bool - // Returns 0 for success, -1 for file skipped, 1 for error. int zupdate_file( const std::string & name, const char * const lzip_name, const std::vector< std::string > & lzip_args2, const bool force, const bool keep_input_files ) { + static int disable_xz = -1; // tri-state bool int format_index = -1; std::string dname; // decompressed_name @@ -167,7 +166,7 @@ int zupdate_file( const std::string & name, const char * const lzip_name, } } const char * const compressor_name = get_compressor_name( format_index ); - if( !compressor_name || !compressor_name[0] ) + if( !compressor_name ) { if( verbosity >= 2 ) std::fprintf( stderr, "%s: Unknown extension in file name '%s' -- ignored.\n", @@ -384,7 +383,7 @@ int main( const int argc, const char * const argv[] ) #endif const char * const lzip_name = get_compressor_name( fmt_lz ); - if( !lzip_name || !lzip_name[0] ) + if( !lzip_name ) { show_error( "Missing name of compressor for lzip format." ); return 1; } for( ; argind < parser.arguments(); ++argind ) |