Module Name:    src
Committed By:   christos
Date:           Sat Jun 18 23:07:04 UTC 2011

Modified Files:
        src/bin/pax: extern.h options.c pax.c

Log Message:
add --xz


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/pax/extern.h
cvs rdiff -u -r1.109 -r1.110 src/bin/pax/options.c
cvs rdiff -u -r1.45 -r1.46 src/bin/pax/pax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/pax/extern.h
diff -u src/bin/pax/extern.h:1.56 src/bin/pax/extern.h:1.57
--- src/bin/pax/extern.h:1.56	Tue Apr  7 15:52:35 2009
+++ src/bin/pax/extern.h	Sat Jun 18 19:07:04 2011
@@ -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;

Index: src/bin/pax/options.c
diff -u src/bin/pax/options.c:1.109 src/bin/pax/options.c:1.110
--- src/bin/pax/options.c:1.109	Mon Aug 30 23:16:06 2010
+++ src/bin/pax/options.c	Sat Jun 18 19:07:04 2011
@@ -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;

Index: src/bin/pax/pax.c
diff -u src/bin/pax/pax.c:1.45 src/bin/pax/pax.c:1.46
--- src/bin/pax/pax.c:1.45	Sat Jul 19 20:52:40 2008
+++ src/bin/pax/pax.c	Sat Jun 18 19:07:04 2011
@@ -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) */

Reply via email to