Skip to content

Commit

Permalink
Version 1.21.3-at.20231213.03. Write Wget build information to warcin…
Browse files Browse the repository at this point in the history
…fo record. Add Archive Team contact details to --version and --help messages.
  • Loading branch information
Arkiver2 committed Dec 13, 2023
1 parent 0e7d903 commit 28bec41
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .tarball-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.3-at.20231213.02
1.21.3-at.20231213.03
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.3-at.20231213.02
1.21.3-at.20231213.03
30 changes: 29 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,39 @@ AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC

dnl
dnl Get canonical host
dnl Get canonical host system
dnl
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([OS_TYPE], "$host_os",
[Define to be the name of the operating system.])
AC_DEFINE_UNQUOTED([SYSTEM_HOST_OS], "$host_os",
[Define to be the name of the host operating system.])
AC_DEFINE_UNQUOTED([SYSTEM_HOST_CPU], "$host_cpu",
[Define to be the name of the host CPU.])
AC_DEFINE_UNQUOTED([SYSTEM_HOST_VENDOR], "$host_vendor",
[Define to be the name of the host vendor.])

dnl
dnl Get canonical build system
dnl
AC_CANONICAL_BUILD
AC_DEFINE_UNQUOTED([SYSTEM_BUILD_OS], "$build_os",
[Define to be the name of the build operating system.])
AC_DEFINE_UNQUOTED([SYSTEM_BUILD_CPU], "$build_cpu",
[Define to be the name of the build CPU.])
AC_DEFINE_UNQUOTED([SYSTEM_BUILD_VENDOR], "$build_vendor",
[Define to be the name of the build vendor.])

dnl
dnl Get canonical target system
dnl
AC_CANONICAL_TARGET
AC_DEFINE_UNQUOTED([SYSTEM_TARGET_OS], "$target_os",
[Define to be the name of the target operating system.])
AC_DEFINE_UNQUOTED([SYSTEM_TARGET_CPU], "$target_cpu",
[Define to be the name of the target CPU.])
AC_DEFINE_UNQUOTED([SYSTEM_TARGET_VENDOR], "$target_vendor",
[Define to be the name of the target vendor.])

dnl Non-verbose make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Expand Down
13 changes: 10 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,9 +1101,11 @@ Recursive accept/reject:\n"),
-np, --no-parent don't ascend to the parent directory\n"),
"\n",
N_("Email bug reports, questions, discussions to <[email protected]>\n"
"and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.\n")
"and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.\n"),
"\n",
N_("For the additions in Wget-AT over Wget please open an issue at\n"
"https://github.com/ArchiveTeam/wget-lua.\n")
"https://github.com/ArchiveTeam/wget-lua, send an email to\n"
"<[email protected]>, or visit #archiveteam-dev on hackint IRC.\n")
};

size_t i;
Expand Down Expand Up @@ -1417,7 +1419,12 @@ There is NO WARRANTY, to the extent permitted by law.\n"), stdout) < 0)
if (fputs (_("\nOriginally written by Hrvoje Niksic <[email protected]>.\n"),
stdout) < 0)
exit (WGET_EXIT_IO_FAIL);
if (fputs (_("Please send bug reports and questions to <[email protected]>.\n"),
if (fputs (_("For original Wget please send bug reports and questions to\n<[email protected]>.\n"),
stdout) < 0)
exit (WGET_EXIT_IO_FAIL);
if (fputs (_("\nFor the additions in Wget-AT over Wget please open an issue at\n"
"https://github.com/ArchiveTeam/wget-lua, send an email to\n"
"<[email protected]>, or visit #archiveteam-dev on hackint IRC.\n"),
stdout) < 0)
exit (WGET_EXIT_IO_FAIL);

Expand Down
27 changes: 25 additions & 2 deletions src/warc.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ warc_write_warcinfo_record (const char *filename)
FILE *warc_tmp;
char timestamp[22];
char *filename_basename;
int i;

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

if (fprintf (warc_tmp, "software: Wget/%s (%s)\r\n", version_string, OS_TYPE) < 0
if (fprintf (warc_tmp, "operator: Archive Team <[email protected]>\r\n") < 0
|| fprintf (warc_tmp, "software: Wget/%s (%s)\r\n", version_string, OS_TYPE) < 0
|| fprintf (warc_tmp, "format: WARC File Format 1.1\r\n") < 0
|| fprintf (warc_tmp,
"conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1-1_latestdraft.pdf\r\n") < 0
|| fprintf (warc_tmp, "robots: %s\r\n", (opt.use_robots ? "classic" : "off")) < 0
|| fprintf (warc_tmp, "wget-arguments: %s\r\n", program_argstring) < 0)
|| fprintf (warc_tmp, "wget-arguments: %s\r\n", program_argstring) < 0
|| fprintf (warc_tmp, "wget-build-version: %s\r\n", version_string) < 0
|| fprintf (warc_tmp, "wget-build-system-host: %s-%s-%s\r\n",
SYSTEM_HOST_CPU, SYSTEM_HOST_VENDOR, SYSTEM_HOST_OS) < 0
|| fprintf (warc_tmp, "wget-build-system-build: %s-%s-%s\r\n",
SYSTEM_BUILD_CPU, SYSTEM_BUILD_VENDOR, SYSTEM_BUILD_OS) < 0
|| fprintf (warc_tmp, "wget-build-system-target: %s-%s-%s\r\n",
SYSTEM_TARGET_CPU, SYSTEM_TARGET_VENDOR, SYSTEM_TARGET_OS) < 0
|| fprintf (warc_tmp, "wget-build-compilation-string: %s\r\n", compilation_string) < 0
|| fprintf (warc_tmp, "wget-build-link-string: %s\r\n", link_string) < 0
|| fprintf (warc_tmp, "wget-build-features: ") < 0)
{
warc_write_ok = false;
return false;
}

for (i = 0; compiled_features[i]; i++)
{
if (fprintf (warc_tmp, "%s", compiled_features[i]) < 0
|| (compiled_features[i+1] != NULL && fprintf (warc_tmp, " ") < 0)
|| (compiled_features[i+1] == NULL && fprintf (warc_tmp, "\r\n") < 0))
{
warc_write_ok = false;
return false;
}
}

/* Add the user headers, if any. */
if (opt.warc_user_headers)
{
Expand Down

0 comments on commit 28bec41

Please sign in to comment.