Module Name:    src
Committed By:   christos
Date:           Sat Dec 19 18:45:53 UTC 2015

Modified Files:
        src/bin/pax: options.c pax.1

Log Message:
Add the timestamp option to the pax front end.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/bin/pax/options.c
cvs rdiff -u -r1.65 -r1.66 src/bin/pax/pax.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/options.c
diff -u src/bin/pax/options.c:1.117 src/bin/pax/options.c:1.118
--- src/bin/pax/options.c:1.117	Sat Dec 19 13:28:54 2015
+++ src/bin/pax/options.c	Sat Dec 19 13:45:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.117 2015/12/19 18:28:54 christos Exp $	*/
+/*	$NetBSD: options.c,v 1.118 2015/12/19 18:45:52 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.117 2015/12/19 18:28:54 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.118 2015/12/19 18:45:52 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -257,6 +257,8 @@ struct option pax_longopts[] = {
 						OPT_XZ },
 	{ "gnu",		no_argument,		0,
 						OPT_GNU },
+	{ "timestamp",		required_argument,	0,
+						OPT_TIMESTAMP },
 	{ 0,			0,			0,
 						0 },
 };
@@ -667,6 +669,14 @@ pax_options(int argc, char **argv)
 		case OPT_GNU:
 			is_gnutar = 1;
 			break;
+#ifndef SMALL
+		case OPT_TIMESTAMP:
+			if (set_tstamp(optarg, &tst) == -1) {
+				tty_warn(1, "Invalid timestamp `%s'", optarg);
+				tar_usage();
+			}
+			break;
+#endif
 		case '?':
 		default:
 			pax_usage();

Index: src/bin/pax/pax.1
diff -u src/bin/pax/pax.1:1.65 src/bin/pax/pax.1:1.66
--- src/bin/pax/pax.1:1.65	Wed Nov  4 04:24:14 2015
+++ src/bin/pax/pax.1	Sat Dec 19 13:45:52 2015
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pax.1,v 1.65 2015/11/04 09:24:14 wiz Exp $
+.\"    $NetBSD: pax.1,v 1.66 2015/12/19 18:45:52 christos Exp $
 .\"
 .\" Copyright (c) 1992 Keith Muller.
 .\" Copyright (c) 1992, 1993
@@ -33,7 +33,7 @@
 .\"
 .\"	@(#)pax.1	8.4 (Berkeley) 4/18/94
 .\"
-.Dd November 3, 2015
+.Dd December 19, 2015
 .Dt PAX 1
 .Os
 .Sh NAME
@@ -742,6 +742,19 @@ Typical archive format restrictions incl
 file pathname length, file size, link pathname length and the type of the file.
 .It Fl Fl gnu
 Recognize GNU tar extensions.
+.It Fl Fl timestamp Ar timestamp
+Store all modification times in the archive with the
+.Ar timestamp
+given instead of the actual modification time of the individual archive member
+so that repeatable builds are possible.
+The 
+.Ar timestamp
+can be a
+.Pa pathname ,
+where the timestamps are derived from that file, a parseable date for
+.Xr parsedate 3
+(this option is not yet available in the tools build), or an integer value
+interpreted as the number of seconds from the Epoch.
 .It Fl Fl xz
 Use
 .Xr xz 1

Reply via email to