Skip to content

Commit 28bec41

Browse files
committed
Version 1.21.3-at.20231213.03. Write Wget build information to warcinfo record. Add Archive Team contact details to --version and --help messages.
1 parent 0e7d903 commit 28bec41

File tree

5 files changed

+66
-8
lines changed

5 files changed

+66
-8
lines changed

.tarball-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.21.3-at.20231213.02
1+
1.21.3-at.20231213.03

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.21.3-at.20231213.02
1+
1.21.3-at.20231213.03

configure.ac

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,39 @@ AC_USE_SYSTEM_EXTENSIONS
5757
AC_PROG_CC
5858

5959
dnl
60-
dnl Get canonical host
60+
dnl Get canonical host system
6161
dnl
6262
AC_CANONICAL_HOST
6363
AC_DEFINE_UNQUOTED([OS_TYPE], "$host_os",
6464
[Define to be the name of the operating system.])
65+
AC_DEFINE_UNQUOTED([SYSTEM_HOST_OS], "$host_os",
66+
[Define to be the name of the host operating system.])
67+
AC_DEFINE_UNQUOTED([SYSTEM_HOST_CPU], "$host_cpu",
68+
[Define to be the name of the host CPU.])
69+
AC_DEFINE_UNQUOTED([SYSTEM_HOST_VENDOR], "$host_vendor",
70+
[Define to be the name of the host vendor.])
71+
72+
dnl
73+
dnl Get canonical build system
74+
dnl
75+
AC_CANONICAL_BUILD
76+
AC_DEFINE_UNQUOTED([SYSTEM_BUILD_OS], "$build_os",
77+
[Define to be the name of the build operating system.])
78+
AC_DEFINE_UNQUOTED([SYSTEM_BUILD_CPU], "$build_cpu",
79+
[Define to be the name of the build CPU.])
80+
AC_DEFINE_UNQUOTED([SYSTEM_BUILD_VENDOR], "$build_vendor",
81+
[Define to be the name of the build vendor.])
82+
83+
dnl
84+
dnl Get canonical target system
85+
dnl
86+
AC_CANONICAL_TARGET
87+
AC_DEFINE_UNQUOTED([SYSTEM_TARGET_OS], "$target_os",
88+
[Define to be the name of the target operating system.])
89+
AC_DEFINE_UNQUOTED([SYSTEM_TARGET_CPU], "$target_cpu",
90+
[Define to be the name of the target CPU.])
91+
AC_DEFINE_UNQUOTED([SYSTEM_TARGET_VENDOR], "$target_vendor",
92+
[Define to be the name of the target vendor.])
6593

6694
dnl Non-verbose make
6795
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

src/main.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,9 +1101,11 @@ Recursive accept/reject:\n"),
11011101
-np, --no-parent don't ascend to the parent directory\n"),
11021102
"\n",
11031103
N_("Email bug reports, questions, discussions to <bug-wget@gnu.org>\n"
1104-
"and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.\n")
1104+
"and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.\n"),
1105+
"\n",
11051106
N_("For the additions in Wget-AT over Wget please open an issue at\n"
1106-
"https://github.com/ArchiveTeam/wget-lua.\n")
1107+
"https://github.com/ArchiveTeam/wget-lua, send an email to\n"
1108+
"<archiveteam@archiveteam.org>, or visit #archiveteam-dev on hackint IRC.\n")
11071109
};
11081110

11091111
size_t i;
@@ -1417,7 +1419,12 @@ There is NO WARRANTY, to the extent permitted by law.\n"), stdout) < 0)
14171419
if (fputs (_("\nOriginally written by Hrvoje Niksic <hniksic@xemacs.org>.\n"),
14181420
stdout) < 0)
14191421
exit (WGET_EXIT_IO_FAIL);
1420-
if (fputs (_("Please send bug reports and questions to <bug-wget@gnu.org>.\n"),
1422+
if (fputs (_("For original Wget please send bug reports and questions to\n<bug-wget@gnu.org>.\n"),
1423+
stdout) < 0)
1424+
exit (WGET_EXIT_IO_FAIL);
1425+
if (fputs (_("\nFor the additions in Wget-AT over Wget please open an issue at\n"
1426+
"https://github.com/ArchiveTeam/wget-lua, send an email to\n"
1427+
"<archiveteam@archiveteam.org>, or visit #archiveteam-dev on hackint IRC.\n"),
14211428
stdout) < 0)
14221429
exit (WGET_EXIT_IO_FAIL);
14231430

src/warc.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,7 @@ warc_write_warcinfo_record (const char *filename)
989989
FILE *warc_tmp;
990990
char timestamp[22];
991991
char *filename_basename;
992+
int i;
992993

993994
/* Write warc-info record as the first record of the file. */
994995
/* We add the record id of this info record to the other records in the
@@ -1015,17 +1016,39 @@ warc_write_warcinfo_record (const char *filename)
10151016
return false;
10161017
}
10171018

1018-
if (fprintf (warc_tmp, "software: Wget/%s (%s)\r\n", version_string, OS_TYPE) < 0
1019+
if (fprintf (warc_tmp, "operator: Archive Team <archiveteam@archiveteam.org>\r\n") < 0
1020+
|| fprintf (warc_tmp, "software: Wget/%s (%s)\r\n", version_string, OS_TYPE) < 0
10191021
|| fprintf (warc_tmp, "format: WARC File Format 1.1\r\n") < 0
10201022
|| fprintf (warc_tmp,
10211023
"conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1-1_latestdraft.pdf\r\n") < 0
10221024
|| fprintf (warc_tmp, "robots: %s\r\n", (opt.use_robots ? "classic" : "off")) < 0
1023-
|| fprintf (warc_tmp, "wget-arguments: %s\r\n", program_argstring) < 0)
1025+
|| fprintf (warc_tmp, "wget-arguments: %s\r\n", program_argstring) < 0
1026+
|| fprintf (warc_tmp, "wget-build-version: %s\r\n", version_string) < 0
1027+
|| fprintf (warc_tmp, "wget-build-system-host: %s-%s-%s\r\n",
1028+
SYSTEM_HOST_CPU, SYSTEM_HOST_VENDOR, SYSTEM_HOST_OS) < 0
1029+
|| fprintf (warc_tmp, "wget-build-system-build: %s-%s-%s\r\n",
1030+
SYSTEM_BUILD_CPU, SYSTEM_BUILD_VENDOR, SYSTEM_BUILD_OS) < 0
1031+
|| fprintf (warc_tmp, "wget-build-system-target: %s-%s-%s\r\n",
1032+
SYSTEM_TARGET_CPU, SYSTEM_TARGET_VENDOR, SYSTEM_TARGET_OS) < 0
1033+
|| fprintf (warc_tmp, "wget-build-compilation-string: %s\r\n", compilation_string) < 0
1034+
|| fprintf (warc_tmp, "wget-build-link-string: %s\r\n", link_string) < 0
1035+
|| fprintf (warc_tmp, "wget-build-features: ") < 0)
10241036
{
10251037
warc_write_ok = false;
10261038
return false;
10271039
}
10281040

1041+
for (i = 0; compiled_features[i]; i++)
1042+
{
1043+
if (fprintf (warc_tmp, "%s", compiled_features[i]) < 0
1044+
|| (compiled_features[i+1] != NULL && fprintf (warc_tmp, " ") < 0)
1045+
|| (compiled_features[i+1] == NULL && fprintf (warc_tmp, "\r\n") < 0))
1046+
{
1047+
warc_write_ok = false;
1048+
return false;
1049+
}
1050+
}
1051+
10291052
/* Add the user headers, if any. */
10301053
if (opt.warc_user_headers)
10311054
{

0 commit comments

Comments
 (0)