diff --git a/ChangeLog b/ChangeLog index fb2bced..418f3fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ lrzip ChangeLog +MAY 2011, Con Kolivas +* Addition of explicit lrzcat symlink which automatically sets "-d -o -" +* Revert automatic output to stdout due to addition of explicit lrzcat +executable, and to be consistent with gzip. + APRIL 2011, version 0.604 Con Kolivas * Detach threads after creating them on the compression side. Not joining them meant that compressing massive files requiring hundreds of threads would diff --git a/Makefile.am b/Makefile.am index 5f99e04..122ee05 100644 --- a/Makefile.am +++ b/Makefile.am @@ -76,9 +76,11 @@ EXTRA_DIST = \ install-exec-hook: $(LN_S) -f lrzip$(EXEEXT) $(DESTDIR)@bindir@/lrunzip$(EXEEXT) + $(LN_S) -f lrzip$(EXEEXT) $(DESTDIR)@bindir@/lrzcat$(EXEEXT) $(LN_S) -f lrztar$(EXEEXT) $(DESTDIR)@bindir@/lrzuntar$(EXEEXT) uninstall-local: rm -f @bindir@/lrunzip + rm -f @bindir@/lrzcat rm -f @bindir@/lrzuntar diff --git a/WHATS-NEW b/WHATS-NEW index 660f51b..809cd4b 100644 --- a/WHATS-NEW +++ b/WHATS-NEW @@ -1,3 +1,7 @@ +Addition of lrzcat - automatically decompresses .lrz files to stdout. +lrzip and lrunzip will no longer automatically output to stdout due to +addition of lrzcat executable, and to be consistent with gzip. + lrzip-0.604 lrzip will no longer fail with a "resource temporarily unavailable" error diff --git a/main.c b/main.c index e6d6663..ae99f13 100644 --- a/main.c +++ b/main.c @@ -505,6 +505,8 @@ int main(int argc, char *argv[]) if (strstr(argv[0], "lrunzip")) control.flags |= FLAG_DECOMPRESS; + else if (strstr(argv[0], "lrzcat")) + control.flags |= FLAG_DECOMPRESS | FLAG_STDOUT; control.compression_level = 7; control.ramsize = get_ram(); @@ -610,12 +612,16 @@ int main(int argc, char *argv[]) case 'o': if (control.outdir) failure("Cannot have -o and -O together\n"); + if (unlikely(STDOUT)) + failure("Cannot specify an output filename when outputting to stdout\n"); control.outname = optarg; control.suffix = ""; break; case 'O': if (control.outname) /* can't mix -o and -O */ failure("Cannot have options -o and -O together\n"); + if (unlikely(STDOUT)) + failure("Cannot specify an output directory when outputting to stdout\n"); control.outdir = malloc(strlen(optarg) + 2); if (control.outdir == NULL) fatal("Failed to allocate for outdir\n"); @@ -634,6 +640,8 @@ int main(int argc, char *argv[]) case 'S': if (control.outname) failure("Specified output filename already, can't specify an extension.\n"); + if (unlikely(STDOUT)) + failure("Cannot specify a filename suffix when outputting to stdout\n"); control.suffix = optarg; break; case 't': @@ -747,9 +755,8 @@ int main(int argc, char *argv[]) } /* If no output filename is specified, and we're using stdin, - * or we detect that stdout is not going to the terminal, * use stdout */ - if (!control.outname && (STDIN || !isatty(fileno((FILE *)stdout)))) { + if (!control.outname && STDIN) { control.flags |= FLAG_STDOUT; control.msgout = stderr; register_outputfile(control.msgout); diff --git a/man/Makefile.am b/man/Makefile.am index cbaed19..d0df432 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,16 +1,19 @@ MAINTAINERCLEANFILES = Makefile.in lrunzip.1 lrztar.1 lrzuntar.1 -man1_MANS = lrzip.1 lrunzip.1 lrztar.1 lrzuntar.1 +man1_MANS = lrzip.1 lrunzip.1 lrzcat.1 lrztar.1 lrzuntar.1 man5_MANS = lrzip.conf.5 -BUILT_SOURCES = lrunzip.1 lrztar.1 lrzuntar.1 +BUILT_SOURCES = lrunzip.1 lrzcat.1 lrztar.1 lrzuntar.1 CLEANFILES = $(BUILT_SOURCES) -EXTRA_DIST = lrzip.1 lrunzip.1.pod lrztar.1.pod lrzuntar.1.pod $(man5_MANS) +EXTRA_DIST = lrzip.1 lrunzip.1.pod lrzcat.1.pod lrztar.1.pod lrzuntar.1.pod $(man5_MANS) lrunzip.1: lrunzip.1.pod pod2man $< $@ +lrzcat.1: lrzcat.1.pod + pod2man $< $@ + lrztar.1: lrztar.1.pod pod2man $< $@ diff --git a/man/lrunzip.1.pod b/man/lrunzip.1.pod index f82b1b0..f5869e2 100644 --- a/man/lrunzip.1.pod +++ b/man/lrunzip.1.pod @@ -1,6 +1,6 @@ # Copyright # -# Copyright (C) 2010 Con Kolivas +# Copyright (C) 2010-2011 Con Kolivas # Copyright (C) 2009-2009 Jari Aalto # # License @@ -65,21 +65,23 @@ None. =head1 SEE ALSO +lrzip.conf(5), +lrzip(1), +lrzcat(1), +lrztar(1), +lrzuntar(1), bzip2(1), gzip(1), lzop(1), -lrzip(1), rzip(1), zip(1) -lrztar(1), -lrzip.conf(5) =head1 AUTHORS Program was written by Con Kolivas. This manual page was written by Jari Aalto (but -may be used by others). Released under license GNU GPL version 2or (at +may be used by others). Released under license GNU GPL version 2 or (at your option) any later version. For more information about license, visit . diff --git a/man/lrzcat.1.pod b/man/lrzcat.1.pod new file mode 100644 index 0000000..d523f1a --- /dev/null +++ b/man/lrzcat.1.pod @@ -0,0 +1,85 @@ +# Copyright +# +# Copyright (C) 2011 Con Kolivas +# +# License +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Description +# +# To learn what TOP LEVEL section to use in manual pages, +# see POSIX/Susv standard and "tility Description Defaults" at +# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11 +# +# This is manual page in Perl POD format. Read more at +# http://perldoc.perl.org/perlpod.html or run command: +# +# perldoc perlpod | less +# +# To check the syntax: +# +# podchecker *.pod +# +# Create manual page with command: +# +# pod2man PAGE.N.pod > PAGE.N + +=pod + +=head1 NAME + +lrzcat - Uncompress LRZ files to STDOUT + +=head1 SYNOPSIS + + lrzcat [options] FILE [... FILE] + +=head1 DESCRIPTION + +lrzcat is identical to C used to decompress files to STDOUT. + +=head1 OPTIONS + +See lrzip(1). + +=head1 ENVIRONMENT + +None. + +=head1 FILES + +None. + +=head1 SEE ALSO + +lrzip.conf(5), +lrzip(1), +lrunzip(1), +lrztar(1), +lrzuntar(1), +bzip2(1), +gzip(1), +lzop(1), +rzip(1), +zip(1) + +=head1 AUTHORS + +This manual page was written by Con Kolivas (but +may be used by others). Released under license GNU GPL version 2 or (at +your option) any later version. For more information about license, +visit . + +=cut diff --git a/man/lrzip.1 b/man/lrzip.1 index a9a321e..c5a8fd0 100644 --- a/man/lrzip.1 +++ b/man/lrzip.1 @@ -1,4 +1,4 @@ -.TH "lrzip" "1" "February 2011" "" "" +.TH "lrzip" "1" "May 2011" "" "" .SH "NAME" lrzip \- a large-file compression program .SH "SYNOPSIS" @@ -9,6 +9,8 @@ lrzip \-d [OPTIONS] .br lrunzip [OPTIONS] .br +lrzcat [OPTIONS] +.br lrztar [lrzip options] .br lrztar \-d [lrzip options] @@ -91,7 +93,8 @@ written is the same as the original archived. .IP "\fB-d\fP" Decompress. If this option is not used then lrzip looks at the name used to launch the program. If it contains the string -"lrunzip" then the \-d option is automatically set. +"lrunzip" then the \-d option is automatically set. If it contains the string +"lrzcat" then the \-d \-o \- options are automatically set. .IP .IP "\fB-e\fP" Encrypt. This option enables high grade password encryption using a combination @@ -322,14 +325,15 @@ Nil known. .PP .SH "SEE ALSO" lrzip.conf(5), +lrunzip(1), +lrzcat(1), +lrztar(1), +lrzuntar(1), bzip2(1), gzip(1), lzop(1), -lrzip(1), rzip(1), zip(1) -lrztar(1), -lrzuntar(1) .PP .SH "AUTHOR and CREDITS" diff --git a/man/lrztar.1.pod b/man/lrztar.1.pod index 4166696..9dcca94 100644 --- a/man/lrztar.1.pod +++ b/man/lrztar.1.pod @@ -1,6 +1,6 @@ # Copyright # -# Copyright (C) 2010 Con Kolivas +# Copyright (C) 2010-2011 Con Kolivas # Copyright (C) 2009-2010 Jari Aalto # # License @@ -69,20 +69,23 @@ None. =head1 SEE ALSO +lrzip.conf(5), +lrzuntar(1), +lrzip(1), +lrunzip(1), +lrzcat(1), bzip2(1), gzip(1), lzop(1), -lrzip(1), rzip(1), -zip(1), -lrzip.conf(5) +zip(1) =head1 AUTHORS Program was written by Con Kolivas. This manual page was written by Jari Aalto (but -may be used by others). Released under license GNU GPL version 2or (at +may be used by others). Released under license GNU GPL version 2 or (at your option) any later version. For more information about license, visit . diff --git a/man/lrzuntar.1.pod b/man/lrzuntar.1.pod index 0f85e3d..a070910 100644 --- a/man/lrzuntar.1.pod +++ b/man/lrzuntar.1.pod @@ -1,6 +1,6 @@ # Copyright # -# Copyright (C) 2010 Con Kolivas +# Copyright (C) 2010-2011 Con Kolivas # # License # @@ -47,17 +47,22 @@ None. =head1 SEE ALSO +lrzip.conf(5), lrztar(1), +lrzip(1), +lrunzip(1), +lrzcat(1), bzip2(1), gzip(1), lzop(1), -lrzip(1), rzip(1), -zip(1), -lrzip.conf(5) +zip(1) =head1 AUTHORS -Con Kolivas. +This manual page was written by Con Kolivas (but +may be used by others). Released under license GNU GPL version 2 or (at +your option) any later version. For more information about license, +visit . =cut