Source-Changes-HG archive

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

[src/trunk]: src/bin/pax add --xz



details:   https://anonhg.NetBSD.org/src/rev/44ef10d3c912
branches:  trunk
changeset: 766215:44ef10d3c912
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jun 18 23:07:04 2011 +0000

description:
add --xz

diffstat:

 bin/pax/extern.h  |   4 +---
 bin/pax/options.c |  30 ++++++++++++++++++++----------
 bin/pax/pax.c     |   6 ++----
 3 files changed, 23 insertions(+), 17 deletions(-)

diffs (202 lines):

diff -r 796b3408a570 -r 44ef10d3c912 bin/pax/extern.h
--- a/bin/pax/extern.h  Sat Jun 18 22:19:52 2011 +0000
+++ b/bin/pax/extern.h  Sat Jun 18 23:07:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.56 2009/04/07 19:52:35 perry Exp $        */
+/*     $NetBSD: extern.h,v 1.57 2011/06/18 23:07:04 christos Exp $     */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -233,14 +233,12 @@
 extern int cwdfd;
 extern int dflag;
 extern int iflag;
-extern int jflag;
 extern int kflag;
 extern int lflag;
 extern int nflag;
 extern int tflag;
 extern int uflag;
 extern int vflag;
-extern int zflag;
 extern int Dflag;
 extern int Hflag;
 extern int Lflag;
diff -r 796b3408a570 -r 44ef10d3c912 bin/pax/options.c
--- a/bin/pax/options.c Sat Jun 18 22:19:52 2011 +0000
+++ b/bin/pax/options.c Sat Jun 18 23:07:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: options.c,v 1.109 2010/08/31 03:16:06 enami Exp $      */
+/*     $NetBSD: options.c,v 1.110 2011/06/18 23:07:04 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.109 2010/08/31 03:16:06 enami Exp $");
+__RCSID("$NetBSD: options.c,v 1.110 2011/06/18 23:07:04 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -102,6 +102,7 @@
 
 #define BZIP2_CMD      "bzip2"         /* command to run as bzip2 */
 #define GZIP_CMD       "gzip"          /* command to run as gzip */
+#define XZ_CMD         "xz"            /* command to run as xz */
 #define COMPRESS_CMD   "compress"      /* command to run as compress */
 
 /*
@@ -124,8 +125,9 @@
 #define        OPT_INSECURE                    14
 #define        OPT_STRICT                      15
 #define        OPT_SPARSE                      16
+#define OPT_XZ                         17
 #if !HAVE_NBTOOL_CONFIG_H
-#define        OPT_CHROOT                      17
+#define        OPT_CHROOT                      18
 #endif
 
 /*
@@ -242,6 +244,8 @@
                                                OPT_FORCE_LOCAL },
        { "use-compress-program", required_argument,    0,
                                                OPT_USE_COMPRESS_PROGRAM },
+       { "xz",                 no_argument,            0,
+                                               OPT_XZ },
        { 0,                    0,                      0,
                                                0 },
 };
@@ -320,7 +324,6 @@
                        /*
                         * pass through bzip2
                         */
-                       jflag = 1;
                        gzip_program = BZIP2_CMD;
                        break;
                case 'k':
@@ -476,7 +479,6 @@
                        /*
                         * use gzip.  Non standard option.
                         */
-                       zflag = 1;
                        gzip_program = GZIP_CMD;
                        break;
                case 'A':
@@ -646,9 +648,11 @@
                        forcelocal = 1;
                        break;
                case OPT_USE_COMPRESS_PROGRAM:
-                       zflag = 1;
                        gzip_program = optarg;
                        break;
+               case OPT_XZ:
+                       gzip_program = XZ_CMD;
+                       break;
                case '?':
                default:
                        pax_usage();
@@ -786,6 +790,8 @@
                                                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 },
@@ -914,7 +920,6 @@
                        /*
                         * pass through bzip2. not a standard option
                         */
-                       jflag = 1;
                        gzip_program = BZIP2_CMD;
                        break;
                case 'k':
@@ -1019,7 +1024,6 @@
                        /*
                         * use gzip.  Non standard option.
                         */
-                       zflag = 1;
                        gzip_program = GZIP_CMD;
                        break;
                case 'B':
@@ -1079,7 +1083,6 @@
                        /*
                         * use compress.
                         */
-                       zflag = 1;
                        gzip_program = COMPRESS_CMD;
                        break;
                case '0':
@@ -1107,7 +1110,6 @@
                        /* Just ignore -- we always unlink first. */
                        break;
                case OPT_USE_COMPRESS_PROGRAM:
-                       zflag = 1;
                        gzip_program = optarg;
                        break;
                case OPT_FORCE_LOCAL:
@@ -1132,6 +1134,9 @@
                        do_chroot = 1;
                        break;
 #endif
+               case OPT_XZ:
+                       gzip_program = XZ_CMD;
+                       break;
                default:
                        tar_usage();
                        break;
@@ -1431,6 +1436,8 @@
                                                OPT_INSECURE },
        { "sparse",             no_argument,            0,
                                                OPT_SPARSE },
+       { "xz",                 no_argument,            0,
+                                               OPT_XZ },
 
 #ifdef notyet
 /* Not implemented */
@@ -1745,6 +1752,9 @@
                case OPT_SPARSE:
                        /* do nothing; we already generate sparse files */
                        break;
+               case OPT_XZ:
+                       gzip_program = XZ_CMD;
+                       break;
                default:
                        cpio_usage();
                        break;
diff -r 796b3408a570 -r 44ef10d3c912 bin/pax/pax.c
--- a/bin/pax/pax.c     Sat Jun 18 22:19:52 2011 +0000
+++ b/bin/pax/pax.c     Sat Jun 18 23:07:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pax.c,v 1.45 2008/07/20 00:52:40 lukem Exp $   */
+/*     $NetBSD: pax.c,v 1.46 2011/06/18 23:07:04 christos Exp $        */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -44,7 +44,7 @@
 #if 0
 static char sccsid[] = "@(#)pax.c      8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: pax.c,v 1.45 2008/07/20 00:52:40 lukem Exp $");
+__RCSID("$NetBSD: pax.c,v 1.46 2011/06/18 23:07:04 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -79,14 +79,12 @@
 int    cwdfd = -1;             /* starting cwd */
 int    dflag;                  /* directory member match only  */
 int    iflag;                  /* interactive file/archive rename */
-int    jflag;                  /* pass through bzip2 */
 int    kflag;                  /* do not overwrite existing files */
 int    lflag;                  /* use hard links when possible */
 int    nflag;                  /* select first archive member match */
 int    tflag;                  /* restore access time after read */
 int    uflag;                  /* ignore older modification time files */
 int    vflag;                  /* produce verbose output */
-int    zflag;                  /* use gzip */
 int    Aflag;                  /* honor absolute path */
 int    Dflag;                  /* same as uflag except inode change time */
 int    Hflag;                  /* follow command line symlinks (write only) */



Home | Main Index | Thread Index | Old Index