You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-text/lv/files/lv-xz.patch

44 lines
1.4 KiB

--- a/index.html
+++ b/index.html
@@ -301,8 +301,11 @@
<P>
Compressed files that have suffix ``gz'', ``z'', or ``GZ'', ``Z'' are
extracted by lv using <I>zcat</I> (1),
- and ``bz2'' or ``BZ2'' with <I>bzcat</I> (1).
- Please install <I>zcat</I> and <I>bzcat</I> that can expand all of them.
+ ``bz2'' or ``BZ2'' with <I>bzcat</I> (1).
+ ``lzma'' or ``LZMA'' with <I>lzcat</I> (1).
+ and ``xz'' or ``XZ'' with <I>xzcat</I> (1).
+ Please install <I>zcat</I>, <I>bzcat</I>, <I>lzcat</I> and <I>xzcat</I>
+ that can expand all of them.
<P>
In case that standard output is not connected to an ordinal terminal
but to redirect or pipe-line,
--- a/src/stream.c
+++ b/src/stream.c
@@ -43,6 +43,8 @@
private byte *gz_filter = "zcat";
private byte *bz2_filter = "bzcat";
+private byte *lzma_filter = "lzcat";
+private byte *xz_filter = "xzcat";
private stream_t *StreamAlloc()
{
@@ -75,10 +77,14 @@
filter = gz_filter;
else if( !strcmp( "bz2", exts ) || !strcmp( "BZ2", exts ) )
filter = bz2_filter;
+ else if( !strcmp( "lzma", exts ) || !strcmp( "LZMA", exts ) )
+ filter = lzma_filter;
+ else if( !strcmp( "xz", exts ) || !strcmp( "XZ", exts ) )
+ filter = xz_filter;
}
if( NULL != filter ){
/*
- * zcat or bzcat
+ * zcat, bzcat, lzcat or xzcat
*/
if( NULL == (st->fp = (FILE *)tmpfile()) )
perror( "temporary file" ), exit( -1 );