CVS commit: [netbsd-5] src/bin/pax

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:44:14 UTC 2012

Modified Files:
src/bin/pax [netbsd-5]: ftree.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1799):
bin/pax/ftree.c: revision 1.42
deal properly with empty lines in spec file


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.6.1 src/bin/pax/ftree.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/ftree.c
diff -u src/bin/pax/ftree.c:1.39 src/bin/pax/ftree.c:1.39.6.1
--- src/bin/pax/ftree.c:1.39	Mon Apr 28 20:22:51 2008
+++ src/bin/pax/ftree.c	Wed Oct 17 20:44:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftree.c,v 1.39 2008/04/28 20:22:51 martin Exp $	*/
+/*	$NetBSD: ftree.c,v 1.39.6.1 2012/10/17 20:44:14 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = @(#)ftree.c	8.2 (Berkeley) 4/18/94;
 #else
-__RCSID($NetBSD: ftree.c,v 1.39 2008/04/28 20:22:51 martin Exp $);
+__RCSID($NetBSD: ftree.c,v 1.39.6.1 2012/10/17 20:44:14 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -347,7 +347,7 @@ ftree_arg(void)
 			 * the user didn't supply any args, get the file trees
 			 * to process from stdin;
 			 */
-			for (i = 0; i  PAXPATHLEN + 2; i++) {
+			for (i = 0; i  PAXPATHLEN + 2;) {
 c = getchar();
 if (c == EOF)
 	break;
@@ -355,7 +355,7 @@ ftree_arg(void)
 	if (i != 0)
 		break;
 } else
-	farray[0][i] = c;
+	farray[0][i++] = c;
 			}
 			if (i == 0)
 return -1;



CVS commit: [netbsd-5] src/bin/pax

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 16:52:46 UTC 2010

Modified Files:
src/bin/pax [netbsd-5]: tar.1

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1354):
bin/pax/tar.1: revision 1.28, 1.29
The -X option of tar names a file containing exception globs, not
exception filenames, same as in gtar. PR 41168 from Perry.
--
bump date for previous


To generate a diff of this commit:
cvs rdiff -u -r1.26.12.1 -r1.26.12.2 src/bin/pax/tar.1

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/tar.1
diff -u src/bin/pax/tar.1:1.26.12.1 src/bin/pax/tar.1:1.26.12.2
--- src/bin/pax/tar.1:1.26.12.1	Sun Nov 23 21:25:01 2008
+++ src/bin/pax/tar.1	Sun Mar 28 16:52:46 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: tar.1,v 1.26.12.1 2008/11/23 21:25:01 riz Exp $
+.\ $NetBSD: tar.1,v 1.26.12.2 2010/03/28 16:52:46 snj 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 May 4, 2007
+.Dd March 23, 2010
 .Dt TAR 1
 .Os
 .Sh NAME
@@ -249,7 +249,7 @@
 A line may also specify the positional argument
 .Dq Fl C Ar directory .
 .It Fl X Ar file , Fl -exclude-from Ar file
-Exclude files listed in the given file.
+Exclude files matching the shell glob patterns listed in the given file.
 .\ exclude should be '-E' and '-X' should be one-file-system
 .Pp
 Note that it would be more standard to use this option to mean ``do not



CVS commit: [netbsd-5] src/bin/pax

2010-01-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan 30 19:17:17 UTC 2010

Modified Files:
src/bin/pax [netbsd-5]: options.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1272):
bin/pax/options.c: revision 1.106
Don't use NOGLOB_MTCH for pax, only for tar. Fixes fix for PR 41167 and
closes PR 42301. Since the 41167 fix was pulled up to -5, this needs to
be too.


To generate a diff of this commit:
cvs rdiff -u -r1.101.12.3 -r1.101.12.4 src/bin/pax/options.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/options.c
diff -u src/bin/pax/options.c:1.101.12.3 src/bin/pax/options.c:1.101.12.4
--- src/bin/pax/options.c:1.101.12.3	Fri Aug 14 20:32:21 2009
+++ src/bin/pax/options.c	Sat Jan 30 19:17:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.101.12.3 2009/08/14 20:32:21 snj Exp $	*/
+/*	$NetBSD: options.c,v 1.101.12.4 2010/01/30 19:17:17 snj 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.101.12.3 2009/08/14 20:32:21 snj Exp $);
+__RCSID($NetBSD: options.c,v 1.101.12.4 2010/01/30 19:17:17 snj Exp $);
 #endif
 #endif /* not lint */
 
@@ -692,7 +692,7 @@
 	case LIST:
 	case EXTRACT:
 		for (; optind  argc; optind++)
-			if (pat_add(argv[optind], NULL, NOGLOB_MTCH)  0)
+			if (pat_add(argv[optind], NULL, 0)  0)
 pax_usage();
 		break;
 	case COPY:



CVS commit: [netbsd-5] src/bin/pax

2009-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 13 20:42:59 UTC 2009

Modified Files:
src/bin/pax [netbsd-5]: extern.h file_subs.c options.c pat_rep.c pax.h

Log Message:
Pull up following revision(s) (requested by christo in ticket #678):
bin/pax/extern.h: revision 1.56
bin/pax/file_subs.c: revision 1.62
bin/pax/options.c: revision 1.104
bin/pax/pat_rep.c: revision 1.29
bin/pax/pax.h: revision 1.30
Fixes from christos for pr-41167
XXX -X is still broken, but that wasn't part of this PR.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.8.1 src/bin/pax/extern.h
cvs rdiff -u -r1.61 -r1.61.10.1 src/bin/pax/file_subs.c
cvs rdiff -u -r1.101.12.1 -r1.101.12.2 src/bin/pax/options.c
cvs rdiff -u -r1.28 -r1.28.8.1 src/bin/pax/pat_rep.c src/bin/pax/pax.h

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.55 src/bin/pax/extern.h:1.55.8.1
--- src/bin/pax/extern.h:1.55	Sun Feb 24 20:42:46 2008
+++ src/bin/pax/extern.h	Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.55 2008/02/24 20:42:46 joerg Exp $	*/
+/*	$NetBSD: extern.h,v 1.55.8.1 2009/04/13 20:42:59 snj Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -216,7 +216,7 @@
  * pat_rep.c
  */
 int rep_add(char *);
-int pat_add(char *, char *);
+int pat_add(char *, char *, int);
 void pat_chk(void);
 int pat_sel(ARCHD *);
 int pat_match(ARCHD *);

Index: src/bin/pax/file_subs.c
diff -u src/bin/pax/file_subs.c:1.61 src/bin/pax/file_subs.c:1.61.10.1
--- src/bin/pax/file_subs.c:1.61	Thu Jan 10 04:24:51 2008
+++ src/bin/pax/file_subs.c	Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: file_subs.c,v 1.61 2008/01/10 04:24:51 tls Exp $	*/
+/*	$NetBSD: file_subs.c,v 1.61.10.1 2009/04/13 20:42:59 snj Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)file_subs.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: file_subs.c,v 1.61 2008/01/10 04:24:51 tls Exp $);
+__RCSID($NetBSD: file_subs.c,v 1.61.10.1 2009/04/13 20:42:59 snj Exp $);
 #endif
 #endif /* not lint */
 
@@ -275,15 +275,9 @@
 
 	/*
 	 * We may be running as root, so we have to be sure that link target
-	 * is not a directory, so we lstat and check
+	 * is not a directory, so we lstat and check. XXX: This is still racy.
 	 */
-	if (lstat(arcn-ln_name, sb)  0) {
-		syswarn(1, errno, Cannot link to %s from %s, arcn-ln_name,
-		arcn-name);
-		return -1;
-	}
-
-	if (S_ISDIR(sb.st_mode)) {
+	if (lstat(arcn-ln_name, sb) != -1  S_ISDIR(sb.st_mode)) {
 		tty_warn(1, A hard link to the directory %s is not allowed,
 		arcn-ln_name);
 		return -1;

Index: src/bin/pax/options.c
diff -u src/bin/pax/options.c:1.101.12.1 src/bin/pax/options.c:1.101.12.2
--- src/bin/pax/options.c:1.101.12.1	Sun Nov 23 21:26:50 2008
+++ src/bin/pax/options.c	Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.101.12.1 2008/11/23 21:26:50 riz Exp $	*/
+/*	$NetBSD: options.c,v 1.101.12.2 2009/04/13 20:42:59 snj 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.101.12.1 2008/11/23 21:26:50 riz Exp $);
+__RCSID($NetBSD: options.c,v 1.101.12.2 2009/04/13 20:42:59 snj Exp $);
 #endif
 #endif /* not lint */
 
@@ -692,7 +692,7 @@
 	case LIST:
 	case EXTRACT:
 		for (; optind  argc; optind++)
-			if (pat_add(argv[optind], NULL)  0)
+			if (pat_add(argv[optind], NULL, NOGLOB_MTCH)  0)
 pax_usage();
 		break;
 	case COPY:
@@ -1234,7 +1234,7 @@
 			free(str);
 			continue;
 		}
-		if (pat_add(str, dir)  0)
+		if (pat_add(str, dir, NOGLOB_MTCH)  0)
 			tar_usage();
 		sawpat = 1;
 	}
@@ -1254,7 +1254,7 @@
  		break;
 	chdname = *argv++;
 	havechd++;
-} else if (pat_add(*argv++, chdname)  0)
+} else if (pat_add(*argv++, chdname, 0)  0)
 	tar_usage();
 else
 	sawpat = 1;
@@ -1641,7 +1641,7 @@
 cpio_usage();
 			}
 			while ((str = getline(fp)) != NULL) {
-pat_add(str, NULL);
+pat_add(str, NULL, 0);
 			}
 			fclose(fp);
 			if (getline_error) {
@@ -1780,7 +1780,7 @@
 	case LIST:
 	case EXTRACT:
 		for (; optind  argc; optind++)
-			if (pat_add(argv[optind], 0)  0)
+			if (pat_add(argv[optind], NULL, 0)  0)
 cpio_usage();
 		break;
 	case COPY:

Index: src/bin/pax/pat_rep.c
diff -u src/bin/pax/pat_rep.c:1.28 src/bin/pax/pat_rep.c:1.28.8.1
--- src/bin/pax/pat_rep.c:1.28	Sun Feb 24 20:42:46 2008
+++ src/bin/pax/pat_rep.c	Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pat_rep.c,v 1.28 2008/02/24 20:42:46 joerg Exp $	*/
+/*	$NetBSD: pat_rep.c,v 1.28.8.1 2009/04/13 20:42:59 snj Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)pat_rep.c	8.2 (Berkeley) 4/18/94;
 #else