Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/pax Add -J/--xz to specifically decompress xz compressed...



details:   https://anonhg.NetBSD.org/src/rev/d363434b81a7
branches:  trunk
changeset: 337330:d363434b81a7
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Apr 11 15:41:33 2015 +0000

description:
Add -J/--xz to specifically decompress xz compressed files. We don't really
need this because -z autodetects the compression format; this is for syntax
compatibility with other tar implementations. From Joachim Henke

diffstat:

 bin/pax/options.c |  25 ++++++++++++-------------
 bin/pax/tar.1     |  12 ++++++------
 2 files changed, 18 insertions(+), 19 deletions(-)

diffs (135 lines):

diff -r 21f2b71c5269 -r d363434b81a7 bin/pax/options.c
--- a/bin/pax/options.c Sat Apr 11 15:29:58 2015 +0000
+++ b/bin/pax/options.c Sat Apr 11 15:41:33 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: options.c,v 1.115 2013/11/14 04:00:48 christos Exp $   */
+/*     $NetBSD: options.c,v 1.116 2015/04/11 15:41:33 christos Exp $   */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)options.c  8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: options.c,v 1.115 2013/11/14 04:00:48 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.116 2015/04/11 15:41:33 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -773,6 +773,7 @@
        { "gunzip",             no_argument,            0,      'z' },
        { "read-full-blocks",   no_argument,            0,      'B' },
        { "directory",          required_argument,      0,      'C' },
+       { "xz",                 no_argument,            0,      'J' },
        { "to-stdout",          no_argument,            0,      'O' },
        { "absolute-paths",     no_argument,            0,      'P' },
        { "sparse",             no_argument,            0,      'S' },
@@ -798,8 +799,6 @@
                                                OPT_EXCLUDE },
        { "no-recursion",       no_argument,            0,
                                                OPT_NORECURSE },
-       { "xz",                 no_argument,            0,
-                                               OPT_XZ },
 #if !HAVE_NBTOOL_CONFIG_H
        { "chroot",             no_argument,            0,
                                                OPT_CHROOT },
@@ -877,7 +876,7 @@
         * process option flags
         */
        while ((c = getoldopt(argc, argv,
-           "+b:cef:hjklmopqrs:tuvwxzBC:HI:OPST:X:Z014578",
+           "+b:cef:hjklmopqrs:tuvwxzBC:HI:JOPST:X:Z014578",
            tar_longopts, NULL))
            != -1)  {
                switch(c) {
@@ -966,9 +965,6 @@
                                nopids = 1;
                        }
                        break;
-               case 'O':
-                       Oflag = 1;
-                       break;
                case 'p':
                        /*
                         * preserve user id, group id, file
@@ -1064,6 +1060,12 @@
                        incfiles[nincfiles - 1].file = optarg;
                        incfiles[nincfiles - 1].dir = chdname;
                        break;
+               case 'J':
+                       gzip_program = XZ_CMD;
+                       break;
+               case 'O':
+                       Oflag = 1;
+                       break;
                case 'P':
                        /*
                         * do not remove leading '/' from pathnames
@@ -1142,9 +1144,6 @@
                        do_chroot = 1;
                        break;
 #endif
-               case OPT_XZ:
-                       gzip_program = XZ_CMD;
-                       break;
                default:
                        tar_usage();
                        break;
@@ -2134,8 +2133,8 @@
 static void
 tar_usage(void)
 {
-       (void)fputs("usage: tar [-]{crtux}[-befhjklmopqvwzHOPSXZ014578] [archive] "
-                   "[blocksize]\n"
+       (void)fputs("usage: tar [-]{crtux}[-befhjklmopqvwzHJOPSXZ014578] "
+                   "[archive] [blocksize]\n"
                    "           [-C directory] [-T file] [-s replstr] "
                    "[file ...]\n", stderr);
        exit(1);
diff -r 21f2b71c5269 -r d363434b81a7 bin/pax/tar.1
--- a/bin/pax/tar.1     Sat Apr 11 15:29:58 2015 +0000
+++ b/bin/pax/tar.1     Sat Apr 11 15:41:33 2015 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: tar.1,v 1.33 2012/03/22 07:58:17 wiz Exp $
+.\" $NetBSD: tar.1,v 1.34 2015/04/11 15:41:33 christos Exp $
 .\"
 .\" Copyright (c) 1996 SigmaSoft, Th. Lockert
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\"
 .\"    OpenBSD: tar.1,v 1.28 2000/11/09 23:58:56 aaron Exp
 .\"
-.Dd June 18, 2011
+.Dd April 11, 2015
 .Dt TAR 1
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 .Sh SYNOPSIS
 .Nm tar
 .Sm off
-.Oo \&- Oc {crtux} Op Fl 014578befHhjklmOoPpqSvwXZz
+.Oo \&- Oc {crtux} Op Fl 014578befHhJjklmOoPpqSvwXZz
 .Sm on
 .Op Ar archive
 .Op Ar blocksize
@@ -107,6 +107,9 @@
 .It Fl h , Fl Fl dereference
 Follow symbolic links as if they were normal files
 or directories.
+.It Fl J, Fl Fl xz
+Compress/decompress archive using
+.Xr xz 1 .
 .It Fl j, Fl Fl bzip2, Fl Fl bunzip2
 Use
 .Xr bzip2 1
@@ -209,9 +212,6 @@
 .Nm
 to prompt the user for the filename to use when storing or
 extracting files in an archive.
-.It Fl Fl xz
-Compress/decompress archive using 
-.Xr xz 1 .
 .It Fl z , Fl Fl gzip , Fl Fl gunzip
 Compress/decompress archive using
 .Xr gzip 1 .



Home | Main Index | Thread Index | Old Index