Re: tar -J for xz
On Wed, Oct 05, 2011 at 12:05:18AM +0100, Nicholas Marriott wrote: And from the look of it they also have -J, but .xz is so rarely used right now I'm not sure it is something we really need to copy... That's not gonna be the case from gnome3 (for instance). As I've been told by Antoine, they're going to drop bz2 tarballs entirely.
Re: tar -J for xz
On Wed, 5 Oct 2011, Marc Espie wrote: On Wed, Oct 05, 2011 at 12:05:18AM +0100, Nicholas Marriott wrote: And from the look of it they also have -J, but .xz is so rarely used right now I'm not sure it is something we really need to copy... That's not gonna be the case from gnome3 (for instance). As I've been told by Antoine, they're going to drop bz2 tarballs entirely. To be more precise, it's not gnome3, it's any project hosted by the gnome foundation (e.g. glib, gtk...). -- Antoine
Re: tar -J for xz
Amit Kulkarni amitk...@gmail.com wrote: http://git.tukaani.org/?p=xz.git;a=tree Probably can't import xz into base as parts of xz are GPL v3. Actually all the interesting parts of xz are in the public domain. The details are laid out in COPYING. The GPLv3 part refers to pieces of the autoconf build infrastructure and is probably wrong, but I can't blame the author for being careful and not bothering to disentangle the GNU mess. -- Christian naddy Weisgerber na...@mips.inka.de
Re: tar -J for xz
Nicholas Marriott nicholas.marri...@gmail.com wrote: Or if we must have compression flags just have one flag and let tar figure out the right tool to use. Having -Z -z -J -j etc etc is silly. bsdtar and gtar detect compressed archives automatically and transparently invoke the corresponding decompressor. $ bsdtar tf foo.tar.xz foo/ foo/bla ... However, they can't automatically devine the desired type of compression when creating an archive... Actually, gtar can: If given the -a flag, it will deduce the compressor to choose from the archive name, e.g. $ gtar caf foo.tar.bz2 foo will call bzip2. -- Christian naddy Weisgerber na...@mips.inka.de
tar -J for xz
Hi, this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. Attached is the diff, critical positive or negative would be appreciated ;-). Thanks, Remi. Index: cpio.1 === RCS file: /cvs/src/bin/pax/cpio.1,v retrieving revision 1.34 diff -u -p -r1.34 cpio.1 --- cpio.1 3 Sep 2011 22:59:08 - 1.34 +++ cpio.1 4 Oct 2011 18:23:46 - @@ -32,7 +32,7 @@ .Sh SYNOPSIS .Nm cpio .Fl o -.Op Fl AaBcjLvZz +.Op Fl AaBcjJLvZz .Op Fl C Ar bytes .Op Fl F Ar archive .Op Fl H Ar format @@ -41,7 +41,7 @@ .Op \*(Gt Ar archive .Nm cpio .Fl i -.Op Fl 6BbcdfjmrSstuvZz +.Op Fl 6BbcdfjJmrSstuvZz .Op Fl C Ar bytes .Op Fl E Ar file .Op Fl F Ar archive @@ -110,6 +110,9 @@ POSIX ustar format. .It Fl j Compress archive using the bzip2 format. The bzip2 utility must be installed separately. +.It Fl J +Compress archive using the xz format. +The xz utility must be installed separately. .It Fl L Follow symbolic links. .It Fl O Ar archive @@ -185,6 +188,9 @@ POSIX ustar format. .It Fl j Uncompress archive using the bzip2 format. The bzip2 utility must be installed separately. +.It Fl J +Uncompress archive using the xz format. +The xz utility must be installed separately. .It Fl m Restore modification times on files. .It Fl r Index: options.c === RCS file: /cvs/src/bin/pax/options.c,v retrieving revision 1.74 diff -u -p -r1.74 options.c --- options.c 2 Dec 2010 04:08:27 - 1.74 +++ options.c 4 Oct 2011 18:23:47 - @@ -81,6 +81,7 @@ static int getline_error; #define GZIP_CMD gzip /* command to run as gzip */ #define COMPRESS_CMD compress /* command to run as compress */ #define BZIP2_CMD bzip2 /* command to run as bzip2 */ +#define XZ_CMD xz/* command to run as xz */ /* * Format specific routine table - MUST BE IN SORTED ORDER BY NAME @@ -192,7 +193,7 @@ pax_options(int argc, char **argv) /* * process option flags */ - while ((c=getopt(argc,argv,ab:cdf:ijklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ0)) + while ((c=getopt(argc,argv,ab:cdf:ijJklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ0)) != -1) { switch (c) { case 'a': @@ -245,6 +246,12 @@ pax_options(int argc, char **argv) */ gzip_program = BZIP2_CMD; break; + case 'J': + /* +* use xz. Non standard option. +*/ + gzip_program = XZ_CMD; + break; case 'k': /* * do not clobber files that exist @@ -620,7 +627,7 @@ tar_options(int argc, char **argv) * process option flags */ while ((c = getoldopt(argc, argv, - b:cef:hjmopqruts:vwxzBC:HI:LNOPXZ014578)) != -1) { + b:cef:hjJmopqruts:vwxzBC:HI:LNOPXZ014578)) != -1) { switch (c) { case 'b': /* @@ -671,6 +678,12 @@ tar_options(int argc, char **argv) */ gzip_program = BZIP2_CMD; break; + case 'J': + /* +* use xz. Non standard option. +*/ + gzip_program = XZ_CMD; + break; case 'm': /* * do not preserve modification time @@ -1053,7 +1066,7 @@ cpio_options(int argc, char **argv) dflag = 1; act = -1; nodirs = 1; - while ((c=getopt(argc,argv,abcdfijklmoprstuvzABC:E:F:H:I:LO:SZ6)) != -1) + while ((c=getopt(argc,argv,abcdfijJklmoprstuvzABC:E:F:H:I:LO:SZ6)) != -1) switch (c) { case 'a': /* @@ -1096,6 +1109,12 @@ cpio_options(int argc, char **argv) */ gzip_program = BZIP2_CMD; break; + case 'J': + /* +* use xz. Non standard option. +*/ + gzip_program = XZ_CMD; + break; case 'k': break; case 'l': @@ -1559,11 +1578,11 @@ void pax_usage(void) { (void)fputs( - usage: pax [-0cdjnOvz] [-E limit] [-f archive] [-G group] [-s replstr]\n + usage: pax
Re: tar -J for xz
this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things.
Re: tar -J for xz
this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things. http://git.tukaani.org/?p=xz.git;a=tree Probably can't import xz into base as parts of xz are GPL v3.
Re: tar -J for xz
On 10/4/11, Theo de Raadt dera...@cvs.openbsd.org wrote: this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things. But since our tar already has bzip2 support using 'j' and bzip2 is a port, I'd see no problems in adding 'J' for xz too... ciao, David
Re: tar -J for xz
On Tue, 4 Oct 2011, Theo de Raadt wrote: this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things. Well pval added support for bzip2 years ago in a similar way... -- Antoine
Re: tar -J for xz
On Tue, Oct 04, 2011 at 09:43:53PM +0200, Antoine Jacoutot wrote: this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things. Well pval added support for bzip2 years ago in a similar way... And i don't see the point in all those special flags for special (de)compression tools, not even for gzip. gzip -cd bla.tgz | tar tf - Same for other tools. Why add flags to tar for this?
Re: tar -J for xz
I agree. Or if we must have compression flags just have one flag and let tar figure out the right tool to use. Having -Z -z -J -j etc etc is silly. On Tue, Oct 04, 2011 at 11:41:39PM +0200, Matthias Kilian wrote: On Tue, Oct 04, 2011 at 09:43:53PM +0200, Antoine Jacoutot wrote: this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things. Well pval added support for bzip2 years ago in a similar way... And i don't see the point in all those special flags for special (de)compression tools, not even for gzip. gzip -cd bla.tgz | tar tf - Same for other tools. Why add flags to tar for this?
Re: tar -J for xz
On Tue, Oct 4, 2011 at 4:32 PM, Nicholas Marriott nicholas.marri...@gmail.com wrote: I agree. Or if we must have compression flags just have one flag and let tar figure out the right tool to use. Having -Z -z -J -j etc etc is silly. GNU tar no longer needs those flags... their tar xf foo works just fine whether foo is .tar, .tar.gz, or .tar.bz2. On Tue, Oct 04, 2011 at 11:41:39PM +0200, Matthias Kilian wrote: On Tue, Oct 04, 2011 at 09:43:53PM +0200, Antoine Jacoutot wrote: this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things. Well pval added support for bzip2 years ago in a similar way... And i don't see the point in all those special flags for special (de)compression tools, not even for gzip. gzip -cd bla.tgz | tar tf - Same for other tools. Why add flags to tar for this?
Re: tar -J for xz
Right that was sort of how I was thinking, although I'm not sure it'd be easy to do. And from the look of it they also have -J, but .xz is so rarely used right now I'm not sure it is something we really need to copy... On Tue, Oct 04, 2011 at 04:59:36PM -0600, Anthony J. Bentley wrote: On Tue, Oct 4, 2011 at 4:32 PM, Nicholas Marriott nicholas.marri...@gmail.com wrote: I agree. Or if we must have compression flags just have one flag and let tar figure out the right tool to use. Having -Z -z -J -j etc etc is silly. GNU tar no longer needs those flags... their tar xf foo works just fine whether foo is .tar, .tar.gz, or .tar.bz2. On Tue, Oct 04, 2011 at 11:41:39PM +0200, Matthias Kilian wrote: On Tue, Oct 04, 2011 at 09:43:53PM +0200, Antoine Jacoutot wrote: this diff adds a -J flag to tar that calls xz for compress/decompress. Requires you to install the xz package on your system. No way. Base never depends on external things. Well pval added support for bzip2 years ago in a similar way... And i don't see the point in all those special flags for special (de)compression tools, not even for gzip. gzip -cd bla.tgz | tar tf - Same for other tools. Why add flags to tar for this?