summaryrefslogtreecommitdiffstats
path: root/zupdate.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-05-20 06:48:08 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-05-20 06:48:08 +0000
commit54ee6afc95073460b77bfa6b84550f94bb1a39b5 (patch)
treedca863df8c71f8323c1df714b02814eaaf858ba5 /zupdate.cc
parentAdding upstream version 1.4. (diff)
downloadzutils-54ee6afc95073460b77bfa6b84550f94bb1a39b5.tar.xz
zutils-54ee6afc95073460b77bfa6b84550f94bb1a39b5.zip
Adding upstream version 1.5.upstream/1.5
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r--zupdate.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/zupdate.cc b/zupdate.cc
index 6a94c70..7f08504 100644
--- a/zupdate.cc
+++ b/zupdate.cc
@@ -1,5 +1,5 @@
-/* Zupdate - recompress bzip2, gzip, xz files to lzip files
- Copyright (C) 2013-2015 Antonio Diaz Diaz.
+/* Zupdate - recompress bzip2, gzip, xz files to lzip format
+ Copyright (C) 2013-2016 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -72,7 +72,7 @@ void show_help()
"\nOptions:\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
- " -f, --force do not skip a file even if the .lz exists\n"
+ " -f, --force don't skip a file even if the .lz exists\n"
" -k, --keep keep (don't delete) input files\n"
" -l, --lzip-verbose pass a -v option to the lzip compressor\n"
" -M, --format=<list> process only the formats in <list>\n"
@@ -94,10 +94,10 @@ int cant_execute( const std::string & command, const int status )
if( verbosity >= 0 )
{
if( WIFEXITED( status ) )
- std::fprintf( stderr, "%s: Error executing '%s'. Exit status = %d.\n",
+ std::fprintf( stderr, "%s: Error executing '%s'. Exit status = %d\n",
program_name, command.c_str(), WEXITSTATUS( status ) );
else
- std::fprintf( stderr, "%s: Can't execute '%s'.\n",
+ std::fprintf( stderr, "%s: Can't execute '%s'\n",
program_name, command.c_str() );
}
return 1;
@@ -162,7 +162,7 @@ int zupdate_file( const std::string & name, const char * const lzip_name,
if( stat( name.c_str(), &in_stats ) != 0 ) // check input file
{
if( verbosity >= 0 )
- std::fprintf( stderr, "%s: Can't stat input file '%s': %s.\n",
+ std::fprintf( stderr, "%s: Can't stat input file '%s': %s\n",
program_name, name.c_str(), std::strerror( errno ) );
return 1;
}
@@ -198,7 +198,7 @@ int zupdate_file( const std::string & name, const char * const lzip_name,
if( !lz_exists ) // recompress
{
if( verbosity >= 1 )
- std::fprintf( stderr, "Recompressing file '%s'.\n", name.c_str() );
+ std::fprintf( stderr, "Recompressing file '%s'\n", name.c_str() );
int fda[2]; // pipe between decompressor and compressor
if( pipe( fda ) < 0 )
{ show_error( "Can't create pipe", errno ); return 1; }
@@ -262,13 +262,14 @@ int zupdate_file( const std::string & name, const char * const lzip_name,
{
if( lz_exists && verbosity >= 1 )
- std::fprintf( stderr, "Comparing file '%s'.\n", name.c_str() );
+ std::fprintf( stderr, "Comparing file '%s'\n", name.c_str() );
std::string zcmp_command( invocation_name );
unsigned i = zcmp_command.size();
while( i > 0 && zcmp_command[i-1] != '/' ) --i;
zcmp_command.resize( i );
zcmp_command += "zcmp "; // ${bindir}zcmp
if( no_rcfile ) zcmp_command += "-N ";
+ if( verbosity < 0 ) zcmp_command += "-q ";
zcmp_command += name; zcmp_command += ' '; zcmp_command += rname;
int status = std::system( zcmp_command.c_str() );
if( status != 0 )
@@ -279,7 +280,7 @@ int zupdate_file( const std::string & name, const char * const lzip_name,
if( !keep_input_files && std::remove( name.c_str() ) != 0 && errno != ENOENT )
{
if( verbosity >= 0 )
- std::fprintf( stderr, "%s: Can't delete input file '%s': %s.\n",
+ std::fprintf( stderr, "%s: Can't delete input file '%s': %s\n",
program_name, name.c_str(), std::strerror( errno ) );
return 1;
}