mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
Merged in noryb009/haikuports/wget (pull request #44)
Update wget script to 1.14
This commit is contained in:
@@ -1,105 +0,0 @@
|
||||
diff -urN wget-1.12/configure.ac wget-1.12-haiku/configure.ac
|
||||
--- wget-1.12/configure.ac 2009-09-22 09:39:49.038010880 -0700
|
||||
+++ wget-1.12-haiku/configure.ac 2010-10-22 13:23:29.351797248 -0700
|
||||
@@ -163,6 +163,7 @@
|
||||
AC_CHECK_HEADERS(unistd.h sys/time.h)
|
||||
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h)
|
||||
AC_CHECK_HEADERS(stdint.h inttypes.h pwd.h wchar.h)
|
||||
+AC_CHECK_HEADERS(arpa/inet.h)
|
||||
|
||||
AC_CHECK_DECLS(h_errno,,,[#include <netdb.h>])
|
||||
|
||||
diff -urN wget-1.12/m4/wget.m4 wget-1.12-haiku/m4/wget.m4
|
||||
--- wget-1.12/m4/wget.m4 2009-09-21 20:18:44.034340864 -0700
|
||||
+++ wget-1.12-haiku/m4/wget.m4 2010-10-22 13:22:01.071041024 -0700
|
||||
@@ -117,6 +117,8 @@
|
||||
|
||||
dnl Check whether we need to link with -lnsl and -lsocket, as is the
|
||||
dnl case on e.g. Solaris.
|
||||
+dnl BeOS (BONE) needs libbind as well
|
||||
+dnl Haiku needs libnetwork
|
||||
|
||||
AC_DEFUN([WGET_NSL_SOCKET], [
|
||||
dnl On Solaris, -lnsl is needed to use gethostbyname. But checking
|
||||
@@ -136,6 +138,9 @@
|
||||
AC_CHECK_LIB(nsl, $wget_check_in_nsl)
|
||||
fi
|
||||
AC_CHECK_LIB(socket, socket)
|
||||
+ AC_CHECK_LIB(bind, gethostbyname)
|
||||
+ AC_CHECK_LIB(network, gethostbyname)
|
||||
+ AC_CHECK_LIB(network, socket)
|
||||
])
|
||||
|
||||
|
||||
diff -urN wget-1.12/src/config.h.in wget-1.12-haiku/src/config.h.in
|
||||
--- wget-1.12/src/config.h.in 2009-09-22 09:40:33.008126464 -0700
|
||||
+++ wget-1.12-haiku/src/config.h.in 2010-10-22 13:14:25.000000000 -0700
|
||||
@@ -66,6 +66,9 @@
|
||||
/* Define to 1 if you have the <bp-sym.h> header file. */
|
||||
#undef HAVE_BP_SYM_H
|
||||
|
||||
+/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
+#undef HAVE_ARPA_INET_H
|
||||
+
|
||||
/* Define when using built-in MD5. */
|
||||
#undef HAVE_BUILTIN_MD5
|
||||
|
||||
@@ -212,12 +215,18 @@
|
||||
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
||||
#undef HAVE_LANGINFO_CODESET
|
||||
|
||||
+/* Define to 1 if you have the `bind' library (-lbind). */
|
||||
+#undef HAVE_LIBBIND
|
||||
+
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
/* Define if you have the gnutls library. */
|
||||
#undef HAVE_LIBGNUTLS
|
||||
|
||||
+/* Define to 1 if you have the `network' library (-lnetwork). */
|
||||
+#undef HAVE_LIBNETWORK
|
||||
+
|
||||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
diff -urN wget-1.12/src/connect.c wget-1.12-haiku/src/connect.c
|
||||
--- wget-1.12/src/connect.c 2009-09-21 19:55:56.006815744 -0700
|
||||
+++ wget-1.12-haiku/src/connect.c 2010-10-22 13:14:25.000000000 -0700
|
||||
@@ -45,7 +45,7 @@
|
||||
# include <netdb.h>
|
||||
# endif /* def __VMS [else] */
|
||||
# include <netinet/in.h>
|
||||
-# ifndef __BEOS__
|
||||
+# ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
# endif
|
||||
#endif /* not WINDOWS */
|
||||
diff -urN wget-1.12/src/host.c wget-1.12-haiku/src/host.c
|
||||
--- wget-1.12/src/host.c 2009-09-21 20:00:05.002883584 -0700
|
||||
+++ wget-1.12-haiku/src/host.c 2010-10-22 13:14:25.000000000 -0700
|
||||
@@ -39,7 +39,7 @@
|
||||
# include <sys/types.h>
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
-# ifndef __BEOS__
|
||||
+# ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
# endif
|
||||
# ifdef __VMS
|
||||
diff -urN wget-1.12/src/host.h wget-1.12-haiku/src/host.h
|
||||
--- wget-1.12/src/host.h 2009-09-04 09:31:54.006553600 -0700
|
||||
+++ wget-1.12-haiku/src/host.h 2010-10-22 13:14:25.000000000 -0700
|
||||
@@ -41,9 +41,9 @@
|
||||
# endif /* def __VMS [else] */
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
-#ifndef __BEOS__
|
||||
-# include <arpa/inet.h>
|
||||
-#endif
|
||||
+# ifdef HAVE_ARPA_INET_H
|
||||
+# include <arpa/inet.h>
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
struct url;
|
||||
@@ -1,71 +0,0 @@
|
||||
diff -urN wget-1.13.4/src/http.c wget-1.13.4-haiku/src/http.c
|
||||
--- wget-1.13.4/src/http.c 2011-09-07 03:58:01.006291456 -0700
|
||||
+++ wget-1.13.4-haiku/src/http.c 2012-03-17 12:20:29.000000000 -0700
|
||||
@@ -1046,6 +1046,7 @@
|
||||
char separator)
|
||||
{
|
||||
const char *p = *source;
|
||||
+ int param_type;
|
||||
|
||||
while (c_isspace (*p)) ++p;
|
||||
if (!*p)
|
||||
@@ -1101,7 +1102,7 @@
|
||||
}
|
||||
*source = p;
|
||||
|
||||
- int param_type = modify_param_name(name);
|
||||
+ param_type = modify_param_name(name);
|
||||
if (NOT_RFC2231 != param_type)
|
||||
{
|
||||
modify_param_value(value, param_type);
|
||||
diff -urN wget-1.13.4/src/main.c wget-1.13.4-haiku/src/main.c
|
||||
--- wget-1.13.4/src/main.c 2011-09-06 06:50:11.004456448 -0700
|
||||
+++ wget-1.13.4-haiku/src/main.c 2012-03-17 12:23:37.000000000 -0700
|
||||
@@ -913,14 +913,16 @@
|
||||
int i, ret, longindex;
|
||||
int nurl;
|
||||
bool append_to_log = false;
|
||||
-
|
||||
- total_downloaded_bytes = 0;
|
||||
-
|
||||
- program_name = argv[0];
|
||||
+ int retconf;
|
||||
+ bool use_userconfig = false;
|
||||
|
||||
struct ptimer *timer = ptimer_new ();
|
||||
double start_time = ptimer_measure (timer);
|
||||
|
||||
+ total_downloaded_bytes = 0;
|
||||
+
|
||||
+ program_name = argv[0];
|
||||
+
|
||||
i18n_initialize ();
|
||||
|
||||
/* Construct the name of the executable, without the directory part. */
|
||||
@@ -948,8 +950,6 @@
|
||||
/* This seperate getopt_long is needed to find the user config
|
||||
and parse it before the other user options. */
|
||||
longindex = -1;
|
||||
- int retconf;
|
||||
- bool use_userconfig = false;
|
||||
|
||||
while ((retconf = getopt_long (argc, argv,
|
||||
short_options, long_options, &longindex)) != -1)
|
||||
@@ -1432,11 +1432,14 @@
|
||||
&&
|
||||
total_downloaded_bytes != 0)
|
||||
{
|
||||
+ char *wall_time;
|
||||
+ char *download_time;
|
||||
double end_time = ptimer_measure (timer);
|
||||
ptimer_destroy (timer);
|
||||
-
|
||||
- char *wall_time = xstrdup (secs_to_human_time (end_time - start_time));
|
||||
- char *download_time = xstrdup (secs_to_human_time (total_download_time));
|
||||
+
|
||||
+ wall_time = xstrdup (secs_to_human_time (end_time - start_time));
|
||||
+ download_time = xstrdup (secs_to_human_time (total_download_time));
|
||||
+
|
||||
logprintf (LOG_NOTQUIET,
|
||||
_("FINISHED --%s--\nTotal wall clock time: %s\n"
|
||||
"Downloaded: %d files, %s in %s (%s)\n"),
|
||||
521
net-misc/wget/patches/wget-1.14-build-fixes.patch
Normal file
521
net-misc/wget/patches/wget-1.14-build-fixes.patch
Normal file
@@ -0,0 +1,521 @@
|
||||
From 106dffb05519f44684f5f9dc09b0970b8c68a2d9 Mon Sep 17 00:00:00 2001
|
||||
From: Luke <noryb009@gmail.com>
|
||||
Date: Wed, 11 Dec 2013 03:03:50 +0000
|
||||
Subject: [PATCH] Fix build errors
|
||||
|
||||
---
|
||||
lib/regcomp.c | 2 +-
|
||||
src/http.c | 9 ++++--
|
||||
src/main.c | 25 ++++++++------
|
||||
src/retr.c | 3 +-
|
||||
src/utils.c | 2 ++
|
||||
src/warc.c | 102 ++++++++++++++++++++++++++++++++++++----------------------
|
||||
6 files changed, 91 insertions(+), 52 deletions(-)
|
||||
|
||||
diff --git a/lib/regcomp.c b/lib/regcomp.c
|
||||
index 1d7a522..76ed566 100644
|
||||
--- a/lib/regcomp.c
|
||||
+++ b/lib/regcomp.c
|
||||
@@ -952,10 +952,10 @@ static void
|
||||
internal_function
|
||||
init_word_char (re_dfa_t *dfa)
|
||||
{
|
||||
- dfa->word_ops_used = 1;
|
||||
int i = 0;
|
||||
int j;
|
||||
int ch = 0;
|
||||
+ dfa->word_ops_used = 1;
|
||||
if (BE (dfa->map_notascii == 0, 1))
|
||||
{
|
||||
bitset_word_t bits0 = 0x00000000;
|
||||
diff --git a/src/http.c b/src/http.c
|
||||
index fa2d5ed..8500a93 100644
|
||||
--- a/src/http.c
|
||||
+++ b/src/http.c
|
||||
@@ -1076,6 +1076,7 @@ extract_param (const char **source, param_token *name, param_token *value,
|
||||
char separator)
|
||||
{
|
||||
const char *p = *source;
|
||||
+ int param_type;
|
||||
|
||||
while (c_isspace (*p)) ++p;
|
||||
if (!*p)
|
||||
@@ -1131,7 +1132,7 @@ extract_param (const char **source, param_token *name, param_token *value,
|
||||
}
|
||||
*source = p;
|
||||
|
||||
- int param_type = modify_param_name(name);
|
||||
+ param_type = modify_param_name(name);
|
||||
if (NOT_RFC2231 != param_type)
|
||||
{
|
||||
modify_param_value(value, param_type);
|
||||
@@ -1521,6 +1522,7 @@ read_response_body (struct http_stat *hs, int sock, FILE *fp, wgint contlen,
|
||||
int warc_payload_offset = 0;
|
||||
FILE *warc_tmp = NULL;
|
||||
int warcerr = 0;
|
||||
+ int flags;
|
||||
|
||||
if (opt.warc_filename != NULL)
|
||||
{
|
||||
@@ -1557,7 +1559,7 @@ read_response_body (struct http_stat *hs, int sock, FILE *fp, wgint contlen,
|
||||
}
|
||||
|
||||
/* Read the response body. */
|
||||
- int flags = 0;
|
||||
+ flags = 0;
|
||||
if (contlen != -1)
|
||||
/* If content-length is present, read that much; otherwise, read
|
||||
until EOF. The HTTP spec doesn't require the server to
|
||||
@@ -1668,6 +1670,7 @@ static uerr_t
|
||||
gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
||||
struct iri *iri, int count)
|
||||
{
|
||||
+ int warc_tmp_written;
|
||||
struct request *req;
|
||||
|
||||
char *type;
|
||||
@@ -2136,7 +2139,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
||||
warc_payload_offset = ftello (warc_tmp);
|
||||
|
||||
/* Write a copy of the data to the WARC record. */
|
||||
- int warc_tmp_written = fwrite (opt.post_data, 1, post_data_size, warc_tmp);
|
||||
+ warc_tmp_written = fwrite (opt.post_data, 1, post_data_size, warc_tmp);
|
||||
if (warc_tmp_written != post_data_size)
|
||||
write_error = -2;
|
||||
}
|
||||
diff --git a/src/main.c b/src/main.c
|
||||
index b8b2869..cff4fa3 100644
|
||||
--- a/src/main.c
|
||||
+++ b/src/main.c
|
||||
@@ -971,13 +971,20 @@ main (int argc, char **argv)
|
||||
int i, ret, longindex;
|
||||
int nurl;
|
||||
bool append_to_log = false;
|
||||
+ struct ptimer *timer;
|
||||
+ double start_time;
|
||||
+ int arglen;
|
||||
+ int argstring_length;
|
||||
+ int retconf;
|
||||
+ bool use_userconfig = false;
|
||||
+ char *p;
|
||||
|
||||
total_downloaded_bytes = 0;
|
||||
|
||||
program_name = argv[0];
|
||||
|
||||
- struct ptimer *timer = ptimer_new ();
|
||||
- double start_time = ptimer_measure (timer);
|
||||
+ timer = ptimer_new ();
|
||||
+ start_time = ptimer_measure (timer);
|
||||
|
||||
i18n_initialize ();
|
||||
|
||||
@@ -999,10 +1006,10 @@ main (int argc, char **argv)
|
||||
#endif
|
||||
|
||||
/* Construct the arguments string. */
|
||||
- int argstring_length = 1;
|
||||
+ argstring_length = 1;
|
||||
for (i = 1; i < argc; i++)
|
||||
argstring_length += strlen (argv[i]) + 2 + 1;
|
||||
- char *p = program_argstring = malloc (argstring_length * sizeof (char));
|
||||
+ p = program_argstring = malloc (argstring_length * sizeof (char));
|
||||
if (p == NULL)
|
||||
{
|
||||
fprintf (stderr, _("Memory allocation problem\n"));
|
||||
@@ -1011,7 +1018,7 @@ main (int argc, char **argv)
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
*p++ = '"';
|
||||
- int arglen = strlen (argv[i]);
|
||||
+ arglen = strlen (argv[i]);
|
||||
memcpy (p, argv[i], arglen);
|
||||
p += arglen;
|
||||
*p++ = '"';
|
||||
@@ -1027,8 +1034,6 @@ main (int argc, char **argv)
|
||||
/* This separate getopt_long is needed to find the user config file
|
||||
option ("--config") and parse it before the other user options. */
|
||||
longindex = -1;
|
||||
- int retconf;
|
||||
- bool use_userconfig = false;
|
||||
|
||||
while ((retconf = getopt_long (argc, argv,
|
||||
short_options, long_options, &longindex)) != -1)
|
||||
@@ -1597,10 +1602,12 @@ outputting to a regular file.\n"));
|
||||
total_downloaded_bytes != 0)
|
||||
{
|
||||
double end_time = ptimer_measure (timer);
|
||||
+ char *wall_time;
|
||||
+ char *download_time;
|
||||
ptimer_destroy (timer);
|
||||
|
||||
- char *wall_time = xstrdup (secs_to_human_time (end_time - start_time));
|
||||
- char *download_time = xstrdup (secs_to_human_time (total_download_time));
|
||||
+ wall_time = xstrdup (secs_to_human_time (end_time - start_time));
|
||||
+ download_time = xstrdup (secs_to_human_time (total_download_time));
|
||||
logprintf (LOG_NOTQUIET,
|
||||
_("FINISHED --%s--\nTotal wall clock time: %s\n"
|
||||
"Downloaded: %d files, %s in %s (%s)\n"),
|
||||
diff --git a/src/retr.c b/src/retr.c
|
||||
index 6204839..7947a73 100644
|
||||
--- a/src/retr.c
|
||||
+++ b/src/retr.c
|
||||
@@ -374,8 +374,9 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
|
||||
|
||||
if (ret > 0)
|
||||
{
|
||||
+ int write_res;
|
||||
sum_read += ret;
|
||||
- int write_res = write_data (out, out2, dlbuf, ret, &skip, &sum_written);
|
||||
+ write_res = write_data (out, out2, dlbuf, ret, &skip, &sum_written);
|
||||
if (write_res != 0)
|
||||
{
|
||||
ret = (write_res == -3) ? -3 : -2;
|
||||
diff --git a/src/utils.c b/src/utils.c
|
||||
index 567dc35..736f6e2 100644
|
||||
--- a/src/utils.c
|
||||
+++ b/src/utils.c
|
||||
@@ -64,7 +64,9 @@ as that of the covered work. */
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* For TIOCGWINSZ and friends: */
|
||||
+#ifndef __HAIKU__
|
||||
#include <sys/ioctl.h>
|
||||
+#endif
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
# include <termios.h>
|
||||
#endif
|
||||
diff --git a/src/warc.c b/src/warc.c
|
||||
index 69f80be..17a48aa 100644
|
||||
--- a/src/warc.c
|
||||
+++ b/src/warc.c
|
||||
@@ -154,10 +154,11 @@ warc_write_buffer (const char *buffer, size_t size)
|
||||
static bool
|
||||
warc_write_string (const char *str)
|
||||
{
|
||||
+ size_t n;
|
||||
if (!warc_write_ok)
|
||||
return false;
|
||||
|
||||
- size_t n = strlen (str);
|
||||
+ n = strlen (str);
|
||||
if (n != warc_write_buffer (str, n))
|
||||
warc_write_ok = false;
|
||||
|
||||
@@ -246,8 +247,11 @@ warc_write_block_from_file (FILE *data_in)
|
||||
{
|
||||
/* Add the Content-Length header. */
|
||||
char *content_length;
|
||||
+ char buffer[BUFSIZ];
|
||||
+ size_t s;
|
||||
+
|
||||
fseeko (data_in, 0L, SEEK_END);
|
||||
- if (! asprintf (&content_length, "%ld", ftello (data_in)))
|
||||
+ if (! asprintf (&content_length, "%ld", (long int)ftello (data_in)))
|
||||
{
|
||||
warc_write_ok = false;
|
||||
return false;
|
||||
@@ -262,8 +266,6 @@ warc_write_block_from_file (FILE *data_in)
|
||||
warc_write_ok = false;
|
||||
|
||||
/* Copy the data in the file to the WARC record. */
|
||||
- char buffer[BUFSIZ];
|
||||
- size_t s;
|
||||
while (warc_write_ok && (s = fread (buffer, 1, BUFSIZ, data_in)) > 0)
|
||||
{
|
||||
if (warc_write_buffer (buffer, s) < s)
|
||||
@@ -288,6 +290,12 @@ warc_write_end_record (void)
|
||||
/* We start a new gzip stream for each record. */
|
||||
if (warc_write_ok && warc_current_gzfile)
|
||||
{
|
||||
+ size_t result;
|
||||
+ char static_header[GZIP_STATIC_HEADER_SIZE];
|
||||
+ off_t current_offset;
|
||||
+ off_t uncompressed_size;
|
||||
+ off_t compressed_size;
|
||||
+ char extra_header[EXTRA_GZIP_HEADER_SIZE];
|
||||
if (gzclose (warc_current_gzfile) != Z_OK)
|
||||
{
|
||||
warc_write_ok = false;
|
||||
@@ -313,17 +321,16 @@ warc_write_end_record (void)
|
||||
*/
|
||||
|
||||
/* Calculate the uncompressed and compressed sizes. */
|
||||
- off_t current_offset = ftello (warc_current_file);
|
||||
- off_t uncompressed_size = current_offset - warc_current_gzfile_offset;
|
||||
- off_t compressed_size = warc_current_gzfile_uncompressed_size;
|
||||
+ current_offset = ftello (warc_current_file);
|
||||
+ uncompressed_size = current_offset - warc_current_gzfile_offset;
|
||||
+ compressed_size = warc_current_gzfile_uncompressed_size;
|
||||
|
||||
/* Go back to the static GZIP header. */
|
||||
fseeko (warc_current_file, warc_current_gzfile_offset
|
||||
+ EXTRA_GZIP_HEADER_SIZE, SEEK_SET);
|
||||
|
||||
/* Read the header. */
|
||||
- char static_header[GZIP_STATIC_HEADER_SIZE];
|
||||
- size_t result = fread (static_header, 1, GZIP_STATIC_HEADER_SIZE,
|
||||
+ result = fread (static_header, 1, GZIP_STATIC_HEADER_SIZE,
|
||||
warc_current_file);
|
||||
if (result != GZIP_STATIC_HEADER_SIZE)
|
||||
{
|
||||
@@ -340,7 +347,6 @@ warc_write_end_record (void)
|
||||
fwrite (static_header, 1, GZIP_STATIC_HEADER_SIZE, warc_current_file);
|
||||
|
||||
/* Prepare the extra GZIP header. */
|
||||
- char extra_header[EXTRA_GZIP_HEADER_SIZE];
|
||||
/* XLEN, the length of the extra header fields. */
|
||||
extra_header[0] = ((EXTRA_GZIP_HEADER_SIZE - 2) & 255);
|
||||
extra_header[1] = ((EXTRA_GZIP_HEADER_SIZE - 2) >> 8) & 255;
|
||||
@@ -649,13 +655,15 @@ warc_write_warcinfo_record (char *filename)
|
||||
/* 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
|
||||
file. */
|
||||
+ char timestamp[22];
|
||||
+ char *filename_copy, *filename_basename;
|
||||
+ FILE *warc_tmp;
|
||||
+
|
||||
warc_current_warcinfo_uuid_str = (char *) malloc (48);
|
||||
warc_uuid_str (warc_current_warcinfo_uuid_str);
|
||||
|
||||
- char timestamp[22];
|
||||
warc_timestamp (timestamp);
|
||||
|
||||
- char *filename_copy, *filename_basename;
|
||||
filename_copy = strdup (filename);
|
||||
filename_basename = strdup (basename (filename_copy));
|
||||
|
||||
@@ -667,7 +675,7 @@ warc_write_warcinfo_record (char *filename)
|
||||
warc_write_header ("WARC-Filename", filename_basename);
|
||||
|
||||
/* Create content. */
|
||||
- FILE *warc_tmp = warc_tempfile ();
|
||||
+ warc_tmp = warc_tempfile ();
|
||||
if (warc_tmp == NULL)
|
||||
{
|
||||
free (filename_copy);
|
||||
@@ -717,6 +725,10 @@ warc_write_warcinfo_record (char *filename)
|
||||
static bool
|
||||
warc_start_new_file (bool meta)
|
||||
{
|
||||
+ int base_filename_length;
|
||||
+ char *new_filename;
|
||||
+ const char *extension;
|
||||
+
|
||||
if (opt.warc_filename == NULL)
|
||||
return false;
|
||||
|
||||
@@ -729,15 +741,15 @@ warc_start_new_file (bool meta)
|
||||
|
||||
warc_current_file_number++;
|
||||
|
||||
- int base_filename_length = strlen (opt.warc_filename);
|
||||
+ base_filename_length = strlen (opt.warc_filename);
|
||||
/* filename format: base + "-" + 5 digit serial number + ".warc.gz" */
|
||||
- char *new_filename = malloc (base_filename_length + 1 + 5 + 8 + 1);
|
||||
+ new_filename = malloc (base_filename_length + 1 + 5 + 8 + 1);
|
||||
warc_current_filename = new_filename;
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
- const char *extension = (opt.warc_compression_enabled ? "warc.gz" : "warc");
|
||||
+ extension = (opt.warc_compression_enabled ? "warc.gz" : "warc");
|
||||
#else
|
||||
- const char *extension = "warc";
|
||||
+ extension = "warc";
|
||||
#endif
|
||||
|
||||
/* If max size is enabled, we add a serial number to the file names. */
|
||||
@@ -811,12 +823,13 @@ static bool
|
||||
warc_parse_cdx_header (char *lineptr, int *field_num_original_url,
|
||||
int *field_num_checksum, int *field_num_record_id)
|
||||
{
|
||||
+ char *token;
|
||||
+ char *save_ptr;
|
||||
+
|
||||
*field_num_original_url = -1;
|
||||
*field_num_checksum = -1;
|
||||
*field_num_record_id = -1;
|
||||
|
||||
- char *token;
|
||||
- char *save_ptr;
|
||||
token = strtok_r (lineptr, CDX_FIELDSEP, &save_ptr);
|
||||
|
||||
if (token != NULL && strcmp (token, "CDX") == 0)
|
||||
@@ -860,10 +873,12 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url,
|
||||
|
||||
char *token;
|
||||
char *save_ptr;
|
||||
+ int field_num;
|
||||
+
|
||||
token = strtok_r (lineptr, CDX_FIELDSEP, &save_ptr);
|
||||
|
||||
/* Read this line to get the fields we need. */
|
||||
- int field_num = 0;
|
||||
+ field_num = 0;
|
||||
while (token != NULL)
|
||||
{
|
||||
char **val;
|
||||
@@ -926,10 +941,7 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url,
|
||||
static bool
|
||||
warc_load_cdx_dedup_file (void)
|
||||
{
|
||||
- FILE *f = fopen (opt.warc_cdx_dedup_filename, "r");
|
||||
- if (f == NULL)
|
||||
- return false;
|
||||
-
|
||||
+ FILE *f;
|
||||
int field_num_original_url = -1;
|
||||
int field_num_checksum = -1;
|
||||
int field_num_record_id = -1;
|
||||
@@ -938,6 +950,10 @@ warc_load_cdx_dedup_file (void)
|
||||
size_t n = 0;
|
||||
ssize_t line_length;
|
||||
|
||||
+ f = fopen (opt.warc_cdx_dedup_filename, "r");
|
||||
+ if (f == NULL)
|
||||
+ return false;
|
||||
+
|
||||
/* The first line should contain the CDX header.
|
||||
Format: " CDX x x x x x"
|
||||
where x are field type indicators. For our purposes, we only
|
||||
@@ -965,6 +981,7 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
+ int nrecords;
|
||||
/* Initialize the table. */
|
||||
warc_cdx_dedup_table = hash_table_new (1000, warc_hash_sha1_digest,
|
||||
warc_cmp_sha1_digest);
|
||||
@@ -982,7 +999,7 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n"));
|
||||
while (line_length != -1);
|
||||
|
||||
/* Print results. */
|
||||
- int nrecords = hash_table_count (warc_cdx_dedup_table);
|
||||
+ nrecords = hash_table_count (warc_cdx_dedup_table);
|
||||
logprintf (LOG_VERBOSE, ngettext ("Loaded %d record from CDX.\n\n",
|
||||
"Loaded %d records from CDX.\n\n",
|
||||
nrecords),
|
||||
@@ -1002,12 +1019,14 @@ _("CDX file does not list record ids. (Missing column 'u'.)\n"));
|
||||
static struct warc_cdx_record *
|
||||
warc_find_duplicate_cdx_record (char *url, char *sha1_digest_payload)
|
||||
{
|
||||
+ char *key;
|
||||
+ struct warc_cdx_record *rec_existing;
|
||||
+ int found;
|
||||
+
|
||||
if (warc_cdx_dedup_table == NULL)
|
||||
return NULL;
|
||||
|
||||
- char *key;
|
||||
- struct warc_cdx_record *rec_existing;
|
||||
- int found = hash_table_get_pair (warc_cdx_dedup_table, sha1_digest_payload,
|
||||
+ found = hash_table_get_pair (warc_cdx_dedup_table, sha1_digest_payload,
|
||||
&key, &rec_existing);
|
||||
|
||||
if (found && strcmp (rec_existing->url, url) == 0)
|
||||
@@ -1079,11 +1098,13 @@ warc_init (void)
|
||||
static void
|
||||
warc_write_metadata (void)
|
||||
{
|
||||
+ char manifest_uuid [48];
|
||||
+ FILE * warc_tmp_fp;
|
||||
+
|
||||
/* If there are multiple WARC files, the metadata should be written to a separate file. */
|
||||
if (opt.warc_maxsize > 0)
|
||||
warc_start_new_file (true);
|
||||
|
||||
- char manifest_uuid [48];
|
||||
warc_uuid_str (manifest_uuid);
|
||||
|
||||
fflush (warc_manifest_fp);
|
||||
@@ -1093,7 +1114,7 @@ warc_write_metadata (void)
|
||||
warc_manifest_fp, -1);
|
||||
/* warc_write_resource_record has closed warc_manifest_fp. */
|
||||
|
||||
- FILE * warc_tmp_fp = warc_tempfile ();
|
||||
+ warc_tmp_fp = warc_tempfile ();
|
||||
if (warc_tmp_fp == NULL)
|
||||
{
|
||||
logprintf (LOG_NOTQUIET, _("Could not open temporary WARC file.\n"));
|
||||
@@ -1148,10 +1169,11 @@ FILE *
|
||||
warc_tempfile (void)
|
||||
{
|
||||
char filename[100];
|
||||
+ int fd;
|
||||
if (path_search (filename, 100, opt.warc_tempdir, "wget", true) == -1)
|
||||
return NULL;
|
||||
|
||||
- int fd = mkstemp (filename);
|
||||
+ fd = mkstemp (filename);
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
@@ -1210,8 +1232,10 @@ warc_write_cdx_record (const char *url, const char *timestamp_str,
|
||||
off_t offset, const char *warc_filename,
|
||||
const char *response_uuid)
|
||||
{
|
||||
- /* Transform the timestamp. */
|
||||
char timestamp_str_cdx [15];
|
||||
+ const char *checksum;
|
||||
+
|
||||
+ /* Transform the timestamp. */
|
||||
memcpy (timestamp_str_cdx , timestamp_str , 4); /* "YYYY" "-" */
|
||||
memcpy (timestamp_str_cdx + 4, timestamp_str + 5, 2); /* "mm" "-" */
|
||||
memcpy (timestamp_str_cdx + 6, timestamp_str + 8, 2); /* "dd" "T" */
|
||||
@@ -1221,7 +1245,6 @@ warc_write_cdx_record (const char *url, const char *timestamp_str,
|
||||
timestamp_str_cdx[14] = '\0';
|
||||
|
||||
/* Rewrite the checksum. */
|
||||
- const char *checksum;
|
||||
if (payload_digest != NULL)
|
||||
checksum = payload_digest + 5; /* Skip the "sha1:" */
|
||||
else
|
||||
@@ -1235,7 +1258,7 @@ warc_write_cdx_record (const char *url, const char *timestamp_str,
|
||||
/* Print the CDX line. */
|
||||
fprintf (warc_current_cdx_file, "%s %s %s %s %d %s %s - %ld %s %s\n", url,
|
||||
timestamp_str_cdx, url, mime_type, response_code, checksum,
|
||||
- redirect_location, offset, warc_current_filename, response_uuid);
|
||||
+ redirect_location, (long int)offset, warc_current_filename, response_uuid);
|
||||
fflush (warc_current_cdx_file);
|
||||
|
||||
return true;
|
||||
@@ -1260,10 +1283,11 @@ warc_write_revisit_record (char *url, char *timestamp_str,
|
||||
char *refers_to, ip_address *ip, FILE *body)
|
||||
{
|
||||
char revisit_uuid [48];
|
||||
- warc_uuid_str (revisit_uuid);
|
||||
-
|
||||
char *block_digest = NULL;
|
||||
char sha1_res_block[SHA1_DIGEST_SIZE];
|
||||
+
|
||||
+ warc_uuid_str (revisit_uuid);
|
||||
+
|
||||
sha1_stream (body, sha1_res_block);
|
||||
block_digest = warc_base32_sha1_digest (sha1_res_block);
|
||||
|
||||
@@ -1314,6 +1338,9 @@ warc_write_response_record (char *url, char *timestamp_str,
|
||||
char sha1_res_block[SHA1_DIGEST_SIZE];
|
||||
char sha1_res_payload[SHA1_DIGEST_SIZE];
|
||||
|
||||
+ char response_uuid [48];
|
||||
+ off_t offset;
|
||||
+
|
||||
if (opt.warc_digests_enabled)
|
||||
{
|
||||
/* Calculate the block and payload digests. */
|
||||
@@ -1357,11 +1384,10 @@ warc_write_response_record (char *url, char *timestamp_str,
|
||||
|
||||
/* Not a revisit, just store the record. */
|
||||
|
||||
- char response_uuid [48];
|
||||
warc_uuid_str (response_uuid);
|
||||
|
||||
fseeko (warc_current_file, 0L, SEEK_END);
|
||||
- off_t offset = ftello (warc_current_file);
|
||||
+ offset = ftello (warc_current_file);
|
||||
|
||||
warc_write_start_record ();
|
||||
warc_write_header ("WARC-Type", "response");
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
81
net-misc/wget/patches/wget-1.14-pod-fixes.patch
Normal file
81
net-misc/wget/patches/wget-1.14-pod-fixes.patch
Normal file
@@ -0,0 +1,81 @@
|
||||
diff -Naur wget-1.14.orig/doc/wget.texi wget-1.14.new/doc/wget.texi
|
||||
--- wget-1.14.orig/doc/wget.texi 2012-08-04 02:41:52.000000000 -0600
|
||||
+++ wget-1.14.new/doc/wget.texi 2013-05-26 11:18:52.986107183 -0600
|
||||
@@ -876,7 +876,7 @@
|
||||
actions of one.
|
||||
|
||||
@cindex proxy
|
||||
-@itemx --no-proxy
|
||||
+@item --no-proxy
|
||||
Don't use proxies, even if the appropriate @code{*_proxy} environment
|
||||
variable is defined.
|
||||
|
||||
@@ -977,7 +977,7 @@
|
||||
whose encoding does not match the one used locally.
|
||||
|
||||
@cindex IPv6
|
||||
-@itemx -4
|
||||
+@item -4
|
||||
@itemx --inet4-only
|
||||
@itemx -6
|
||||
@itemx --inet6-only
|
||||
@@ -2106,32 +2106,32 @@
|
||||
|
||||
|
||||
@table @asis
|
||||
-@item 0
|
||||
+@item C<0>
|
||||
No problems occurred.
|
||||
|
||||
-@item 1
|
||||
+@item C<1>
|
||||
Generic error code.
|
||||
|
||||
-@item 2
|
||||
+@item C<2>
|
||||
Parse error---for instance, when parsing command-line options, the
|
||||
@samp{.wgetrc} or @samp{.netrc}...
|
||||
|
||||
-@item 3
|
||||
+@item C<3>
|
||||
File I/O error.
|
||||
|
||||
-@item 4
|
||||
+@item C<4>
|
||||
Network failure.
|
||||
|
||||
-@item 5
|
||||
+@item C<5>
|
||||
SSL verification failure.
|
||||
|
||||
-@item 6
|
||||
+@item C<6>
|
||||
Username/password authentication failure.
|
||||
|
||||
-@item 7
|
||||
+@item C<7>
|
||||
Protocol errors.
|
||||
|
||||
-@item 8
|
||||
+@item C<8>
|
||||
Server issued an error response.
|
||||
@end table
|
||||
|
||||
@@ -3094,7 +3094,7 @@
|
||||
Change setting of passive @sc{ftp}, equivalent to the
|
||||
@samp{--passive-ftp} option.
|
||||
|
||||
-@itemx password = @var{string}
|
||||
+@item password = @var{string}
|
||||
Specify password @var{string} for both @sc{ftp} and @sc{http} file retrieval.
|
||||
This command can be overridden using the @samp{ftp_password} and
|
||||
@samp{http_password} command for @sc{ftp} and @sc{http} respectively.
|
||||
@@ -3605,7 +3605,7 @@
|
||||
may be specified from within Wget itself.
|
||||
|
||||
@table @samp
|
||||
-@itemx --no-proxy
|
||||
+@item --no-proxy
|
||||
@itemx proxy = on/off
|
||||
This option and the corresponding command may be used to suppress the
|
||||
use of proxy, even if the appropriate environment variables are set.
|
||||
90
net-misc/wget/patches/wget-1.14.patch
Normal file
90
net-misc/wget/patches/wget-1.14.patch
Normal file
@@ -0,0 +1,90 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 873c3c9..45d6602 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -161,6 +161,7 @@ AC_HEADER_STDBOOL
|
||||
AC_CHECK_HEADERS(unistd.h sys/time.h)
|
||||
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h)
|
||||
AC_CHECK_HEADERS(stdint.h inttypes.h pwd.h wchar.h)
|
||||
+AC_CHECK_HEADERS(arpa/inet.h)
|
||||
|
||||
AC_CHECK_DECLS(h_errno,,,[#include <netdb.h>])
|
||||
|
||||
diff --git a/m4/wget.m4 b/m4/wget.m4
|
||||
index 02d0cf9..33825e2 100644
|
||||
--- a/m4/wget.m4
|
||||
+++ b/m4/wget.m4
|
||||
@@ -88,6 +88,7 @@ AC_DEFUN([WGET_POSIX_CLOCK], [
|
||||
|
||||
dnl Check whether we need to link with -lnsl and -lsocket, as is the
|
||||
dnl case on e.g. Solaris.
|
||||
+dnl Haiku needs libnetwork
|
||||
|
||||
AC_DEFUN([WGET_NSL_SOCKET], [
|
||||
dnl On Solaris, -lnsl is needed to use gethostbyname. But checking
|
||||
@@ -107,6 +108,8 @@ AC_DEFUN([WGET_NSL_SOCKET], [
|
||||
AC_CHECK_LIB(nsl, $wget_check_in_nsl)
|
||||
fi
|
||||
AC_CHECK_LIB(socket, socket)
|
||||
+ AC_CHECK_LIB(network, gethostbyname)
|
||||
+ AC_CHECK_LIB(network, socket)
|
||||
])
|
||||
|
||||
|
||||
diff --git a/src/config.h.in b/src/config.h.in
|
||||
index 123560b..30a98f9 100644
|
||||
--- a/src/config.h.in
|
||||
+++ b/src/config.h.in
|
||||
@@ -656,6 +656,9 @@
|
||||
/* Define to 1 if you have the <langinfo.h> header file. */
|
||||
#undef HAVE_LANGINFO_H
|
||||
|
||||
+/* Define to 1 if you have the `bind' library (-lbind). */
|
||||
+#undef HAVE_LIBBIND
|
||||
+
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
@@ -668,6 +671,9 @@
|
||||
/* Define if you have the libgnutls library. */
|
||||
#undef HAVE_LIBGNUTLS
|
||||
|
||||
+/* Define to 1 if you have the `network' library (-lnetwork). */
|
||||
+#undef HAVE_LIBNETWORK
|
||||
+
|
||||
/* Define to 1 if you have the `gpg-error' library (-lgpg-error). */
|
||||
#undef HAVE_LIBGPG_ERROR
|
||||
|
||||
diff --git a/src/connect.c b/src/connect.c
|
||||
index 119ccb7..7237484 100644
|
||||
--- a/src/connect.c
|
||||
+++ b/src/connect.c
|
||||
@@ -46,7 +46,7 @@ as that of the covered work. */
|
||||
# include <netdb.h>
|
||||
# endif /* def __VMS [else] */
|
||||
# include <netinet/in.h>
|
||||
-# ifndef __BEOS__
|
||||
+# ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
# endif
|
||||
#endif /* not WINDOWS */
|
||||
diff --git a/src/host.h b/src/host.h
|
||||
index 3f27ea0..3cd3ed9 100644
|
||||
--- a/src/host.h
|
||||
+++ b/src/host.h
|
||||
@@ -42,9 +42,9 @@ as that of the covered work. */
|
||||
# endif /* def __VMS [else] */
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
-#ifndef __BEOS__
|
||||
-# include <arpa/inet.h>
|
||||
-#endif
|
||||
+# ifdef HAVE_ARPA_INET_H
|
||||
+# include <arpa/inet.h>
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
struct url;
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
DESCRIPTION="wget"
|
||||
HOMEPAGE="http://www.gnu.org/software/wget"
|
||||
SRC_URI="http://ftp.gnu.org/gnu/wget/wget-1.12.tar.gz"
|
||||
CHECKSUM_MD5="141461b9c04e454dc8933c9d1f2abf83"
|
||||
REVISION="1"
|
||||
STATUS_HAIKU="broken"
|
||||
DEPEND=""
|
||||
BUILD()
|
||||
{
|
||||
cd wget-1.12
|
||||
libtoolize --force --copy --install
|
||||
aclocal -I m4
|
||||
autoconf
|
||||
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
|
||||
--disable-nls --disable-ipv6
|
||||
make
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd wget-1.12
|
||||
make install
|
||||
}
|
||||
|
||||
LICENSE="GNU GPL v3"
|
||||
COPYRIGHT="2009 Free Software Foundation"
|
||||
@@ -1,22 +0,0 @@
|
||||
DESCRIPTION="wget"
|
||||
HOMEPAGE="http://www.gnu.org/software/wget"
|
||||
SRC_URI="http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz"
|
||||
CHECKSUM_MD5="1df489976a118b9cbe1b03502adbfc27"
|
||||
REVISION="1"
|
||||
STATUS_HAIKU="broken"
|
||||
DEPEND=""
|
||||
BUILD()
|
||||
{
|
||||
cd wget-1.13.4
|
||||
./configure --prefix=`finddir B_COMMON_DIRECTORY` --with-ssl=openssl
|
||||
make
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd wget-1.13.4
|
||||
make install
|
||||
}
|
||||
|
||||
LICENSE="GNU GPL v3"
|
||||
COPYRIGHT="1996-2011 Free Software Foundation"
|
||||
73
net-misc/wget/wget-1.14.recipe
Normal file
73
net-misc/wget/wget-1.14.recipe
Normal file
@@ -0,0 +1,73 @@
|
||||
SUMMARY="wget is a tool for downloading files from the internet"
|
||||
DESCRIPTION="
|
||||
wget is a tool that can download files from the internet through
|
||||
protocols such as HTTP, HTTPS and FTP. wget is non-interactive,
|
||||
so it can be called from scripts.
|
||||
"
|
||||
HOMEPAGE="http://www.gnu.org/software/wget"
|
||||
SRC_URI="http://ftp.gnu.org/gnu/wget/wget-1.14.tar.gz"
|
||||
CHECKSUM_MD5="12edc291dba8127f2e9696e69f36299e"
|
||||
LICENSE="GNU GPL v3"
|
||||
COPYRIGHT="1996-2012 Free Software Foundation"
|
||||
REVISION="1"
|
||||
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
wget$secondaryArchSuffix = $portVersion
|
||||
cmd:wget$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix >= $haikuVersion
|
||||
lib:libcrypto$secondaryArchSuffix
|
||||
lib:libssl$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel >= $haikuVersion
|
||||
devel:libcrypto$secondaryArchSuffix
|
||||
devel:libssl$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix >= 1.2.3
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:aclocal
|
||||
cmd:autoconf
|
||||
cmd:libtoolize
|
||||
cmd:make
|
||||
cmd:makeinfo
|
||||
cmd:pod2man
|
||||
"
|
||||
|
||||
USER_SETTINGS_FILES="
|
||||
settings/wgetrc
|
||||
"
|
||||
|
||||
PATCHES="
|
||||
wget-1.14.patch
|
||||
wget-1.14-build-fixes.patch
|
||||
wget-1.14-pod-fixes.patch
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
libtoolize --force --copy --install
|
||||
aclocal -I m4
|
||||
autoconf
|
||||
runConfigure ./configure --with-ssl=openssl
|
||||
make
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
[ -d .git ] && mv .git .git-temp
|
||||
make check || true
|
||||
[ -d .git-temp ] && mv .git-temp .git
|
||||
}
|
||||
Reference in New Issue
Block a user