summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:37:59 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:37:59 +0000
commit5a8338a2537d1aca007fee7d5c1927b3a83c2da3 (patch)
tree36348dba6840228936b5152149ea57802a0bc81b
parentAdding debian version 1.3~pre1-1. (diff)
downloadzutils-5a8338a2537d1aca007fee7d5c1927b3a83c2da3.tar.xz
zutils-5a8338a2537d1aca007fee7d5c1927b3a83c2da3.zip
Merging upstream version 1.3~pre2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
-rw-r--r--ChangeLog6
-rw-r--r--NEWS7
-rwxr-xr-xconfigure2
-rw-r--r--doc/zcat.12
-rw-r--r--doc/zcmp.12
-rw-r--r--doc/zdiff.12
-rw-r--r--doc/zgrep.12
-rw-r--r--doc/ztest.12
-rw-r--r--doc/zupdate.12
-rw-r--r--doc/zutils.info27
-rw-r--r--doc/zutils.texi9
-rwxr-xr-xtestsuite/check.sh6
-rw-r--r--ztest.cc13
-rw-r--r--zupdate.cc7
14 files changed, 62 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index ca1055c..d539a3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/NEWS b/NEWS
index 27f93f9..1f0ed14 100644
--- a/NEWS
+++ b/NEWS
@@ -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.
diff --git a/configure b/configure
index 6821040..9fd5fa9 100755
--- a/configure
+++ b/configure
@@ -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.
diff --git a/doc/zcat.1 b/doc/zcat.1
index 66a7965..58b1335 100644
--- a/doc/zcat.1
+++ b/doc/zcat.1
@@ -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
diff --git a/doc/zcmp.1 b/doc/zcmp.1
index 2153787..60ffae4 100644
--- a/doc/zcmp.1
+++ b/doc/zcmp.1
@@ -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
diff --git a/ztest.cc b/ztest.cc
index 86a8518..cb78eb1 100644
--- a/ztest.cc
+++ b/ztest.cc
@@ -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)
diff --git a/zupdate.cc b/zupdate.cc
index cf488da..2b3244b 100644
--- a/zupdate.cc
+++ b/zupdate.cc
@@ -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 )