Module Name: src
Committed By: christos
Date: Tue Jun 16 00:47:21 UTC 2020
Modified Files:
src/external/gpl2/groff/dist/src/roff/groff: groff.cpp
src/external/gpl2/groff/dist/src/roff/troff: input.cpp
Log Message:
Add --timestamp for reproducible builds.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl2/groff/dist/src/roff/groff/groff.cpp
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl2/groff/dist/src/roff/troff/input.cpp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl2/groff/dist/src/roff/groff/groff.cpp
diff -u src/external/gpl2/groff/dist/src/roff/groff/groff.cpp:1.1.1.1 src/external/gpl2/groff/dist/src/roff/groff/groff.cpp:1.2
--- src/external/gpl2/groff/dist/src/roff/groff/groff.cpp:1.1.1.1 Wed Jan 13 13:41:48 2016
+++ src/external/gpl2/groff/dist/src/roff/groff/groff.cpp Mon Jun 15 20:47:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: groff.cpp,v 1.1.1.1 2016/01/13 18:41:48 christos Exp $ */
+/* $NetBSD: groff.cpp,v 1.2 2020/06/16 00:47:21 christos Exp $ */
// -*- C++ -*-
/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004
@@ -126,11 +126,12 @@ int main(int argc, char **argv)
commands[TROFF_INDEX].set_name(command_prefix, "troff");
static const struct option long_options[] = {
{ "help", no_argument, 0, 'h' },
+ { "timestamp", required_argument, 0, 'Y' },
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
while ((opt = getopt_long(argc, argv,
- "abcCd:eEf:F:gGhiI:lL:m:M:n:No:pP:r:RsStT:UvVw:W:XzZ",
+ "abcCd:eEf:F:gGhiI:lL:m:M:n:No:pP:r:RsStT:UvVw:W:XY:zZ",
long_options, NULL))
!= EOF) {
char buf[3];
@@ -281,6 +282,9 @@ int main(int argc, char **argv)
usage(stderr);
exit(1);
break;
+ case 'Y':
+ commands[TROFF_INDEX].append_arg(buf, optarg);
+ break;
default:
assert(0);
break;
Index: src/external/gpl2/groff/dist/src/roff/troff/input.cpp
diff -u src/external/gpl2/groff/dist/src/roff/troff/input.cpp:1.4 src/external/gpl2/groff/dist/src/roff/troff/input.cpp:1.5
--- src/external/gpl2/groff/dist/src/roff/troff/input.cpp:1.4 Sat Oct 8 19:40:52 2016
+++ src/external/gpl2/groff/dist/src/roff/troff/input.cpp Mon Jun 15 20:47:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: input.cpp,v 1.4 2016/10/08 23:40:52 joerg Exp $ */
+/* $NetBSD: input.cpp,v 1.5 2020/06/16 00:47:21 christos Exp $ */
// -*- C++ -*-
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
@@ -7242,6 +7242,14 @@ void usage(FILE *stream, const char *pro
" -rcn -Tname -Fdir -Idir -Mdir [files...]\n",
prog);
}
+
+static
+#ifdef LONG_FOR_TIME_T
+long
+#else /* not LONG_FOR_TIME_T */
+time_t
+#endif /* not LONG_FOR_TIME_T */
+timestamp;
int main(int argc, char **argv)
{
@@ -7273,6 +7281,7 @@ int main(int argc, char **argv)
}
static const struct option long_options[] = {
{ "help", no_argument, 0, CHAR_MAX + 1 },
+ { "timestamp", required_argument, 0, 'Y' },
{ "version", no_argument, 0, 'v' },
{ 0, 0, 0, 0 }
};
@@ -7280,7 +7289,7 @@ int main(int argc, char **argv)
#define DEBUG_OPTION "D"
#endif
while ((c = getopt_long(argc, argv,
- "abciI:vw:W:zCEf:m:n:o:r:d:F:M:T:tqs:RU"
+ "abciI:vw:W:zCEf:m:n:o:r:d:F:M:T:tqs:RUY:"
DEBUG_OPTION, long_options, 0))
!= EOF)
switch(c) {
@@ -7383,6 +7392,9 @@ int main(int argc, char **argv)
usage(stdout, argv[0]);
exit(0);
break;
+ case 'Y': // --timestamp
+ timestamp = strtoul(optarg, NULL, 0);
+ break;
case '?':
usage(stderr, argv[0]);
exit(1);
@@ -7485,7 +7497,7 @@ static void init_registers()
#else /* not LONG_FOR_TIME_T */
time_t
#endif /* not LONG_FOR_TIME_T */
- t = time(0);
+ t = timestamp ? timestamp : time(0);
// Use struct here to work around misfeature in old versions of g++.
struct tm *tt = localtime(&t);
set_number_reg("seconds", int(tt->tm_sec));