From: Michihiro NAKAJIMA Date: Thu, 12 Mar 2009 21:27:42 +0000 (-0400) Subject: Reassign option -J to xz compression(--xz) at bsdtar. X-Git-Tag: v2.7.0~167 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c359be02a1851dae4d3d8cecf8d6758cef272845;p=thirdparty%2Flibarchive.git Reassign option -J to xz compression(--xz) at bsdtar. gtar 1.22 has been changed it. SVN-Revision: 762 --- diff --git a/tar/bsdtar.c b/tar/bsdtar.c index c99129f1d..e646c8ba8 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -274,7 +274,7 @@ main(int argc, char **argv) bsdtar->create_compression = opt; #else bsdtar_warnc(bsdtar, 0, - "lzma compression not supported by this version of bsdtar"); + "xz compression not supported by this version of bsdtar"); usage(bsdtar); #endif break; @@ -291,6 +291,19 @@ main(int argc, char **argv) /* GNU tar 1.13 used -l for --one-file-system */ bsdtar->option_warn_links = 1; break; + case OPTION_LZMA: +#if HAVE_LIBLZMA + if (bsdtar->create_compression != '\0') + bsdtar_errc(bsdtar, 1, 0, + "Can't specify both -%c and -%c", opt, + bsdtar->create_compression); + bsdtar->create_compression = opt; +#else + bsdtar_warnc(bsdtar, 0, + "lzma compression not supported by this version of bsdtar"); + usage(bsdtar); +#endif + break; case 'm': /* SUSv2 */ bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME; break; @@ -447,19 +460,6 @@ main(int argc, char **argv) case 'x': /* SUSv2 */ set_mode(bsdtar, opt); break; - case OPTION_XZ: -#if HAVE_LIBLZMA - if (bsdtar->create_compression != '\0') - bsdtar_errc(bsdtar, 1, 0, - "Can't specify both -%c and -%c", opt, - bsdtar->create_compression); - bsdtar->create_compression = opt; -#else - bsdtar_warnc(bsdtar, 0, - "xz compression not supported by this version of bsdtar"); - usage(bsdtar); -#endif - break; case 'y': /* FreeBSD version of GNU tar */ #if HAVE_LIBBZ2 if (bsdtar->create_compression != '\0') diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 8315453e4..168849c12 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -115,6 +115,7 @@ enum { OPTION_HELP, OPTION_INCLUDE, OPTION_KEEP_NEWER_FILES, + OPTION_LZMA, OPTION_NEWER_CTIME, OPTION_NEWER_CTIME_THAN, OPTION_NEWER_MTIME, @@ -129,8 +130,7 @@ enum { OPTION_STRIP_COMPONENTS, OPTION_TOTALS, OPTION_USE_COMPRESS_PROGRAM, - OPTION_VERSION, - OPTION_XZ + OPTION_VERSION }; diff --git a/tar/cmdline.c b/tar/cmdline.c index c24b3d54e..42c832485 100644 --- a/tar/cmdline.c +++ b/tar/cmdline.c @@ -93,7 +93,7 @@ static struct option { { "keep-newer-files", 0, OPTION_KEEP_NEWER_FILES }, { "keep-old-files", 0, 'k' }, { "list", 0, 't' }, - { "lzma", 0, 'J' }, + { "lzma", 0, OPTION_LZMA }, { "modification-time", 0, 'm' }, { "newer", 1, OPTION_NEWER_CTIME }, { "newer-ctime", 1, OPTION_NEWER_CTIME }, @@ -123,7 +123,7 @@ static struct option { { "use-compress-program", 1, OPTION_USE_COMPRESS_PROGRAM }, { "verbose", 0, 'v' }, { "version", 0, OPTION_VERSION }, - { "xz", 0, OPTION_XZ }, + { "xz", 0, 'J' }, { NULL, 0, 0 } }; diff --git a/tar/write.c b/tar/write.c index e24077b4e..643292767 100644 --- a/tar/write.c +++ b/tar/write.c @@ -191,11 +191,11 @@ tar_mode_c(struct bsdtar *bsdtar) #endif #ifdef HAVE_LIBLZMA case 'J': - archive_write_set_compression_lzma(a); - break; - case OPTION_XZ: archive_write_set_compression_xz(a); break; + case OPTION_LZMA: + archive_write_set_compression_lzma(a); + break; #endif #ifdef HAVE_LIBZ case 'z':