Module Name:    othersrc
Committed By:   agc
Date:           Fri Mar  1 07:28:20 UTC 2013

Modified Files:
        othersrc/external/bsd/mat/dist: frontends.c mat.1 matpax.1

Log Message:
Allow the user and group for entries in the archive to be specified
from the command line with a new "-A user=root -A group=wheel" style
of invocation.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 othersrc/external/bsd/mat/dist/frontends.c
cvs rdiff -u -r1.9 -r1.10 othersrc/external/bsd/mat/dist/mat.1
cvs rdiff -u -r1.6 -r1.7 othersrc/external/bsd/mat/dist/matpax.1

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

Modified files:

Index: othersrc/external/bsd/mat/dist/frontends.c
diff -u othersrc/external/bsd/mat/dist/frontends.c:1.7 othersrc/external/bsd/mat/dist/frontends.c:1.8
--- othersrc/external/bsd/mat/dist/frontends.c:1.7	Mon Nov 26 16:00:54 2012
+++ othersrc/external/bsd/mat/dist/frontends.c	Fri Mar  1 07:28:20 2013
@@ -157,6 +157,7 @@ mat_tar(int argc, char **argv)
 	char		 cwd[MAT_PATH_MAX];
 	char		*metalog;
 	char		*dir;
+	char		*eq;
 	char		*f;
 	int		 deltemp;
 	int		 fd;
@@ -178,8 +179,17 @@ mat_tar(int argc, char **argv)
 		argv[1] = newarg;
 	}
 	getopt2_init(&options);
-	while ((i = getopt2(&options, argc, argv, "C:T:Vacf:ps:tvx")) != -1) {
+	while ((i = getopt2(&options, argc, argv, "A:C:T:Vacf:ps:tvx")) != -1) {
 		switch(i) {
+		case 'A':
+			if ((eq = strchr(options.optarg, '=')) != NULL) {
+				if (strncmp(options.optarg, "user", 4) == 0) {
+					snprintf(mat.user, sizeof(mat.user), "%s", eq + 1);
+				} else if (strncmp(options.optarg, "group", 5) == 0) {
+					snprintf(mat.group, sizeof(mat.group), "%s", eq + 1);
+				}
+			}
+			break;
 		case 'C':
 			dir = options.optarg;
 			break;
@@ -328,6 +338,7 @@ mat_pax(int argc, char **argv)
 	char		*metalog;
 	char		*archive;
 	char		*dir;
+	char		*eq;
 	int		 deltemp;
 	int		 fd;
 	int		 ok;
@@ -345,8 +356,17 @@ mat_pax(int argc, char **argv)
 	action = "list";
 	deltemp = 0;
 	getopt2_init(&options);
-	while ((i = getopt2(&options, argc, argv, "C:Vaf:lrs:wv")) != -1) {
+	while ((i = getopt2(&options, argc, argv, "A:C:Vaf:lrs:wv")) != -1) {
 		switch(i) {
+		case 'A':
+			if ((eq = strchr(options.optarg, '=')) != NULL) {
+				if (strncmp(options.optarg, "user", 4) == 0) {
+					snprintf(mat.user, sizeof(mat.user), "%s", eq + 1);
+				} else if (strncmp(options.optarg, "group", 5) == 0) {
+					snprintf(mat.group, sizeof(mat.group), "%s", eq + 1);
+				}
+			}
+			break;
 		case 'C':
 			dir = options.optarg;
 			break;

Index: othersrc/external/bsd/mat/dist/mat.1
diff -u othersrc/external/bsd/mat/dist/mat.1:1.9 othersrc/external/bsd/mat/dist/mat.1:1.10
--- othersrc/external/bsd/mat/dist/mat.1:1.9	Sat Jun 25 17:19:55 2011
+++ othersrc/external/bsd/mat/dist/mat.1	Fri Mar  1 07:28:20 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: mat.1,v 1.9 2011/06/25 17:19:55 wiz Exp $
+.\" $NetBSD: mat.1,v 1.10 2013/03/01 07:28:20 agc Exp $
 .\"
 .\" Copyright (c) 2011 Alistair Crooks <a...@netbsd.org>
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 25, 2011
+.Dd February 28, 2013
 .Dt MATTAR 1
 .Os
 .Sh NAME
@@ -32,6 +32,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl acptVvx
+.Op Fl A Ar key=value
 .Op Fl C Ar directory
 .Op Fl f Ar archive
 .Op Fl s Ar substitution
@@ -67,6 +68,13 @@ option using programs such as
 .Xr diff 1
 to see if anything has been modified since the archive contents
 were extracted.
+.It Fl A Ar key=value
+allows key values of
+.Dq user
+and
+.Dq group
+to be set on the archive entries
+from the command line.
 .It Fl C Ar directory
 perform an initial
 .Xr chdir 2

Index: othersrc/external/bsd/mat/dist/matpax.1
diff -u othersrc/external/bsd/mat/dist/matpax.1:1.6 othersrc/external/bsd/mat/dist/matpax.1:1.7
--- othersrc/external/bsd/mat/dist/matpax.1:1.6	Sat Jun 25 17:19:55 2011
+++ othersrc/external/bsd/mat/dist/matpax.1	Fri Mar  1 07:28:20 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: matpax.1,v 1.6 2011/06/25 17:19:55 wiz Exp $
+.\" $NetBSD: matpax.1,v 1.7 2013/03/01 07:28:20 agc Exp $
 .\"
 .\" Copyright (c) 2011 Alistair Crooks <a...@netbsd.org>
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 25, 2011
+.Dd February 28, 2013
 .Dt MATPAX 1
 .Os
 .Sh NAME
@@ -32,6 +32,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl alrVvw
+.Op Fl A Ar key=value
 .Op Fl C Ar directory
 .Op Fl f Ar archive
 .Op Fl s Ar substitution
@@ -65,6 +66,13 @@ so that tools such as
 .Xr diff 1
 can be used to compare packages and installed file system entries to
 see if anything has been changed.
+.It Fl A Ar key=value
+allows key values of
+.Dq user
+and
+.Dq group
+to be set on the archive entries
+from the command line.
 .It Fl C Ar directory
 perform an initial
 .Xr chdir 2

Reply via email to