]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Reassign option -J to xz compression(--xz) at bsdtar.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 12 Mar 2009 21:27:42 +0000 (17:27 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 12 Mar 2009 21:27:42 +0000 (17:27 -0400)
gtar 1.22 has been changed it.

SVN-Revision: 762

tar/bsdtar.c
tar/bsdtar.h
tar/cmdline.c
tar/write.c

index c99129f1da1870eb87190f4cc29ae44250f39728..e646c8ba811f48dbbff5e3f5b1f16feffa016a82 100644 (file)
@@ -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')
index 8315453e4a4777f96821cfebd4634a41b81f869b..168849c12f0646ac362e3c3e831141498954ec60 100644 (file)
@@ -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
 };
 
 
index c24b3d54efe41670300315904313a5fd089ff386..42c83248537f74d2520c907eadf3377fcadc07f0 100644 (file)
@@ -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 }
 };
 
index e24077b4e76a17d1a85bf64c55b7140e6d8c3382..6432927673bb6783b37c7b159d0701e212df96c0 100644 (file)
@@ -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':