Automated merge with file:/home/micah/devel/wget/eleven

This commit is contained in:
Micah Cowan 2007-10-09 11:17:26 -07:00
commit f2956990ca
9 changed files with 180 additions and 120 deletions

View File

@ -1,3 +1,14 @@
2007-10-02 Gisle Vanem <gvanem@broadpark.no>
* config.h: Removed unused defines, added needed 'HAVE_*' defines.
* Makefile.DJ: rewritten to be used from './src' directory.
Added '-DOPENSSL_NO_KRB5' for OpenSSL build. Target is
now wget.exe.
* Makefile.WC: Added for building with OpenWatcom targeting
32-bit DOS (DOS32A extender).
2007-09-24 Gisle Vanem <giva@bgnett.no> 2007-09-24 Gisle Vanem <giva@bgnett.no>
* Makefile.DJ, config.h: Added to support building on MS-DOS via * Makefile.DJ, config.h: Added to support building on MS-DOS via

View File

@ -1,28 +1,33 @@
# #
# GNU Makefile for wget / djgpp / MSDOS. # GNU Makefile for wget / djgpp / MSDOS.
# By Gisle Vanem <giva@bgnett.no>. # By Gisle Vanem <giva@bgnett.no> 2007.
# #
.SUFFIXES: .exe .map # `cd' to `./src' and issue the command:
# make -f ../msdos/Makefile.dj
#
.SUFFIXES: .exe
USE_OPENSSL = 0 USE_OPENSSL = 0
USE_IPV6 = 1 USE_IPV6 = 1
#
# Change to suite.
#
OPENSSL_ROOT = e:/net/OpenSSL.099 OPENSSL_ROOT = e:/net/OpenSSL.099
ZLIB_ROOT = e:/djgpp/contrib/zlib ZLIB_ROOT = e:/djgpp/contrib/zlib
VPATH = ../src
OBJ_DIR = djgpp.obj OBJ_DIR = djgpp.obj
CC = gcc CC = gcc
CFLAGS = -O2 -g -Wall -Wcast-align -I. -I../src -I/dev/env/WATT_ROOT/inc \ CFLAGS = -O2 -g -Wall -Wcast-align -I. -I../msdos -I/dev/env/WATT_ROOT/inc \
-DHAVE_CONFIG_H -DENABLE_DEBUG -DHAVE_CONFIG_H -DENABLE_DEBUG
# LDFLAGS = -s # LDFLAGS = -s
ifeq ($(USE_OPENSSL),1) ifeq ($(USE_OPENSSL),1)
CFLAGS += -DHAVE_OPENSSL -DHAVE_SSL -I$(OPENSSL_ROOT) CFLAGS += -DHAVE_OPENSSL -DHAVE_SSL -DOPENSSL_NO_KRB5 -I$(OPENSSL_ROOT)
EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a \ EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a \
$(ZLIB_ROOT)/libz.a $(ZLIB_ROOT)/libz.a
SOURCES = ../src/openssl.c ../src/http-ntlm.c SOURCES += openssl.c http-ntlm.c
endif endif
ifeq ($(USE_IPV6),1) ifeq ($(USE_IPV6),1)
@ -31,28 +36,28 @@ endif
EX_LIBS += /dev/env/WATT_ROOT/lib/libwatt.a EX_LIBS += /dev/env/WATT_ROOT/lib/libwatt.a
SOURCES += $(addprefix ../src/, cmpt.c connect.c cookies.c ftp.c ftp-basic.c \ SOURCES += cmpt.c connect.c cookies.c ftp.c ftp-basic.c ftp-ls.c \
ftp-ls.c ftp-opie.c getopt.c hash.c host.c html-parse.c html-url.c \ ftp-opie.c getopt.c hash.c host.c html-parse.c html-url.c \
http.c init.c log.c main.c gen-md5.c gnu-md5.c netrc.c progress.c \ http.c init.c log.c main.c gen-md5.c gnu-md5.c netrc.c \
recur.c res.c retr.c safe-ctype.c url.c utils.c version.c convert.c \ progress.c recur.c res.c retr.c safe-ctype.c url.c utils.c \
xmalloc.c ptimer.c spider.c) version.c convert.c xmalloc.c ptimer.c spider.c
OBJECTS = $(addprefix $(OBJ_DIR)/, $(notdir $(SOURCES:.c=.o))) OBJECTS = $(addprefix $(OBJ_DIR)/, $(SOURCES:.c=.o))
all: $(OBJ_DIR) ../wget-dos.exe all: $(OBJ_DIR) wget.exe
@echo 'Welcome to Wget' @echo 'Welcome to Wget'
$(OBJ_DIR): $(OBJ_DIR):
mkdir $(OBJ_DIR) mkdir $(OBJ_DIR)
../wget-dos.exe: $(OBJECTS) wget.exe: $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^ $(EX_LIBS) $(CC) $(LDFLAGS) -o $@ $^ $(EX_LIBS)
clean: clean:
rm -f $(OBJECTS) $(MAPFILE) rm -f $(OBJECTS) $(MAPFILE)
vclean realclean: clean vclean realclean: clean
rm -f ../wget-dos.exe depend.dj rm -f wget.exe depend.dj
- rmdir $(OBJ_DIR) - rmdir $(OBJ_DIR)
$(OBJ_DIR)/%.o: %.c $(OBJ_DIR)/%.o: %.c

49
msdos/Makefile.WC Normal file
View File

@ -0,0 +1,49 @@
#
# Makefile for Wget / DOS32A / OpenWatcom
# by G. Vanem <gvanem@broadpark.no> 2007
#
COMPILE = *wcc386 -mf -3r -w6 -d2 -zq -zm -of -I. -I$(%watt_root)\inc &
-I..\msdos -fr=nul -bt=dos -s -dHAVE_CONFIG_H -dENABLE_DEBUG &
-dSIZEOF_INT=4
LINK = *wlink option quiet, map, verbose, eliminate, caseexact, stack=100k &
debug all system dos32a
OBJ_DIR = Watcom.obj
OBJECTS = $(OBJ_DIR)\cmpt.obj $(OBJ_DIR)\connect.obj &
$(OBJ_DIR)\convert.obj $(OBJ_DIR)\cookies.obj &
$(OBJ_DIR)\ftp-basic.obj $(OBJ_DIR)\ftp-ls.obj &
$(OBJ_DIR)\ftp-opie.obj $(OBJ_DIR)\ftp.obj &
$(OBJ_DIR)\gen-md5.obj $(OBJ_DIR)\getopt.obj &
$(OBJ_DIR)\gnu-md5.obj $(OBJ_DIR)\hash.obj &
$(OBJ_DIR)\host.obj $(OBJ_DIR)\html-parse.obj &
$(OBJ_DIR)\html-url.obj $(OBJ_DIR)\http.obj &
$(OBJ_DIR)\init.obj $(OBJ_DIR)\log.obj &
$(OBJ_DIR)\main.obj $(OBJ_DIR)\netrc.obj &
$(OBJ_DIR)\progress.obj $(OBJ_DIR)\ptimer.obj &
$(OBJ_DIR)\recur.obj $(OBJ_DIR)\res.obj &
$(OBJ_DIR)\retr.obj $(OBJ_DIR)\safe-ctype.obj &
$(OBJ_DIR)\spider.obj $(OBJ_DIR)\url.obj &
$(OBJ_DIR)\utils.obj $(OBJ_DIR)\version.obj &
$(OBJ_DIR)\xmalloc.obj
all: $(OBJ_DIR) wget.exe .SYMBOLIC
@echo 'Welcome to Wget / Watcom'
$(OBJ_DIR):
- mkdir $^@
.ERASE
.c{$(OBJ_DIR)}.obj:
*$(COMPILE) $[@ -fo=$@
wget.exe: $(OBJECTS)
$(LINK) name $@ file { $(OBJECTS) } library $(%watt_root)\lib\wattcpwf.lib
clean: .SYMBOLIC
- rm $(OBJ_DIR)\*.obj wget.exe wget.map
- rmdir $(OBJ_DIR)

View File

@ -46,39 +46,29 @@
#endif #endif
#if defined(__HIGHC__) #if defined(__HIGHC__)
#define inline
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1 #define HAVE_UTIME_H 1
#endif #endif
#if defined(__WATCOMC__) || defined(__BORLANDC__) #if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__HIGHC__)
#define inline #define inline
#endif #endif
#ifdef HAVE_SSL
#define OPENSSL_NO_KRB5
#endif
#define STDC_HEADERS 1
#define RETSIGTYPE void
#define USE_OPIE 1 #define USE_OPIE 1
#define USE_DIGEST 1 #define USE_DIGEST 1
#define DEBUG #define DEBUG
#ifdef __DJGPP__ #ifdef __DJGPP__
#define HAVE_STRUCT_UTIMBUF 1 #define HAVE__BOOL 1
#define HAVE_UNAME 1
#define HAVE_UTIME_H 1
#define HAVE_STRCASECMP 1 #define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1 #define HAVE_STRNCASECMP 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_USLEEP 1
#define HAVE_SIGNAL 1
#define HAVE_BASENAME 1
#define HAVE_SIGSETJMP 1 #define HAVE_SIGSETJMP 1
#define HAVE_SIGBLOCK 1 #define HAVE_SIGBLOCK 1
#define HAVE__BOOL 1 #define HAVE_STRUCT_UTIMBUF 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_USLEEP 1
#define HAVE_UTIME_H 1
#define HAVE_INT64_T 1
#if (DJGPP_MINOR >= 4) #if (DJGPP_MINOR >= 4)
#include <stdbool.h> #include <stdbool.h>
@ -94,32 +84,18 @@
#endif #endif
#ifdef OPENWATCOM_15 #ifdef OPENWATCOM_15
#define HAVE_STRCASECMP #define HAVE_INT64_T 1
#define HAVE_STRNCASECMP #define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_UTIME_H 1
#endif #endif
#define HAVE_GETHOSTBYNAME 1 #define HAVE_PROCESS_H 1
#define HAVE_GETHOSTNAME 1
#define HAVE_SELECT 1
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1
#define HAVE_STRERROR 1
#define HAVE_STRSTR 1
#define HAVE_MKTIME 1
#define HAVE_STDARG_H 1
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_MD5 1
#define HAVE_BUILTIN_MD5 1 #define HAVE_BUILTIN_MD5 1
#define HAVE_ISATTY 1 #define HAVE_ISATTY 1
#define HAVE_MEMMOVE 1
#define OS_TYPE "DOS"
#define CTRLBREAK_BACKGND 1
#define PROTOTYPES 1
#define WGET_USE_STDARG
#define lookup_host wget_lookuphost #define lookup_host wget_lookuphost
#define select select_s #define select select_s
@ -129,15 +105,16 @@
#define sock_write wget_sock_write #define sock_write wget_sock_write
#define sock_close wget_sock_close #define sock_close wget_sock_close
#if defined(__DJGPP__) #if !defined(__DJGPP__)
#define MKDIR(p,a) mkdir(p,a) #include <direct.h>
#else #define mkdir(p,a) (mkdir)(p)
#define strcasecmp stricmp #define strcasecmp stricmp
#define MKDIR(p,a) mkdir(p)
#endif #endif
#if !defined(MSDOS) #if !defined(MSDOS)
#define MSDOS #define MSDOS
#endif #endif
#define OS_TYPE "DOS"
#endif /* CONFIG_DOS_H */ #endif /* CONFIG_DOS_H */

View File

@ -5,6 +5,14 @@
* wget.h: Remove logic for handling lack of NLS (now in * wget.h: Remove logic for handling lack of NLS (now in
gettext.h). gettext.h).
2007-10-08 Micah Cowan <micah@cowan.name>
* http.c (http_loop): Add send_head_first conditional back
around code that needs it, but not around the last-modified
header-parsing stuff this time. Removed no-longer-useful (was it
ever?) restart_loop boolean, continuing unconditionally at end
of send_head_first conditional block (if we haven't jumped out).
2007-10-04 Micah Cowan <micah@cowan.name> 2007-10-04 Micah Cowan <micah@cowan.name>
* http.c (http_loop): We've got_name if content_disposition * http.c (http_loop): We've got_name if content_disposition
@ -13,6 +21,14 @@
* Makefile.in: Removed, replaced by Makefile.am. * Makefile.in: Removed, replaced by Makefile.am.
* Makefile.am: Converted from Makefile.in. * Makefile.am: Converted from Makefile.in.
2007-10-02 Gisle Vanem <gvanem@broadpark.no>
* ftp.c: Use "_listing" for MSDOS (".listing" is illegal).
* url.c: Update comment for 'filechr_not_windows'.
* utils.c: Include <process.h> for 'getpid()' on Watcom.
2007-10-02 Micah Cowan <micah@cowan.name> 2007-10-02 Micah Cowan <micah@cowan.name>
* ftp.c (getftp, ftp_loop_internal), http.c (http_loop), main * ftp.c (getftp, ftp_loop_internal), http.c (http_loop), main

View File

@ -51,7 +51,11 @@ so, delete this exception statement from your version. */
#include "recur.h" /* for INFINITE_RECURSION */ #include "recur.h" /* for INFINITE_RECURSION */
/* File where the "ls -al" listing will be saved. */ /* File where the "ls -al" listing will be saved. */
#ifdef MSDOS
#define LIST_FILENAME "_listing"
#else
#define LIST_FILENAME ".listing" #define LIST_FILENAME ".listing"
#endif
typedef struct typedef struct
{ {

View File

@ -2545,7 +2545,7 @@ Remote file does not exist -- broken link!!!\n"));
/* Did we get the time-stamp? */ /* Did we get the time-stamp? */
if (!got_head) if (!got_head)
{ {
bool restart_loop = false; got_head = true; /* no more time-stamping */
if (opt.timestamping && !hstat.remote_time) if (opt.timestamping && !hstat.remote_time)
{ {
@ -2563,92 +2563,87 @@ Last-modified header invalid -- time-stamp ignored.\n"));
time_came_from_head = true; time_came_from_head = true;
} }
/* The time-stamping section. */ if (send_head_first)
if (opt.timestamping)
{ {
if (hstat.orig_file_name) /* Perform the following checks only /* The time-stamping section. */
if the file we're supposed to if (opt.timestamping)
download already exists. */
{ {
if (hstat.remote_time && if (hstat.orig_file_name) /* Perform the following
tmr != (time_t) (-1)) checks only if the file
we're supposed to
download already exists. */
{ {
/* Now time-stamping can be used validly. Time-stamping if (hstat.remote_time &&
means that if the sizes of the local and remote file tmr != (time_t) (-1))
match, and local file is newer than the remote file,
it will not be retrieved. Otherwise, the normal
download procedure is resumed. */
if (hstat.orig_file_tstamp >= tmr)
{ {
if (hstat.contlen == -1 /* Now time-stamping can be used validly.
|| hstat.orig_file_size == hstat.contlen) Time-stamping means that if the sizes of
the local and remote file match, and local
file is newer than the remote file, it will
not be retrieved. Otherwise, the normal
download procedure is resumed. */
if (hstat.orig_file_tstamp >= tmr)
{ {
logprintf (LOG_VERBOSE, _("\ if (hstat.contlen == -1
|| hstat.orig_file_size == hstat.contlen)
{
logprintf (LOG_VERBOSE, _("\
Server file no newer than local file `%s' -- not retrieving.\n\n"), Server file no newer than local file `%s' -- not retrieving.\n\n"),
hstat.orig_file_name); hstat.orig_file_name);
ret = RETROK; ret = RETROK;
goto exit; goto exit;
}
else
{
logprintf (LOG_VERBOSE, _("\
The sizes do not match (local %s) -- retrieving.\n"),
number_to_static_string (hstat.orig_file_size));
}
} }
else else
{ logputs (LOG_VERBOSE,
logprintf (LOG_VERBOSE, _("\ _("Remote file is newer, retrieving.\n"));
The sizes do not match (local %s) -- retrieving.\n"),
number_to_static_string (hstat.orig_file_size));
}
}
else
logputs (LOG_VERBOSE,
_("Remote file is newer, retrieving.\n"));
logputs (LOG_VERBOSE, "\n"); logputs (LOG_VERBOSE, "\n");
}
} }
/* free_hstat (&hstat); */
hstat.timestamp_checked = true;
} }
/* free_hstat (&hstat); */ if (opt.spider)
hstat.timestamp_checked = true;
restart_loop = true;
}
if (opt.spider)
{
if (opt.recursive)
{ {
if (*dt & TEXTHTML) if (opt.recursive)
{ {
logputs (LOG_VERBOSE, _("\ if (*dt & TEXTHTML)
{
logputs (LOG_VERBOSE, _("\
Remote file exists and could contain links to other resources -- retrieving.\n\n")); Remote file exists and could contain links to other resources -- retrieving.\n\n"));
restart_loop = true; }
else
{
logprintf (LOG_VERBOSE, _("\
Remote file exists but does not contain any link -- not retrieving.\n\n"));
ret = RETROK; /* RETRUNNEEDED is not for caller. */
goto exit;
}
} }
else else
{ {
logprintf (LOG_VERBOSE, _("\ logprintf (LOG_VERBOSE, _("\
Remote file exists but does not contain any link -- not retrieving.\n\n")); Remote file exists but recursion is disabled -- not retrieving.\n\n"));
ret = RETROK; /* RETRUNNEEDED is not for caller. */ ret = RETROK; /* RETRUNNEEDED is not for caller. */
goto exit; goto exit;
} }
} }
else
{
logprintf (LOG_VERBOSE, _("\
Remote file exists but recursion is disabled -- not retrieving.\n\n"));
ret = RETROK; /* RETRUNNEEDED is not for caller. */
goto exit;
}
}
if (send_head_first)
{
got_name = true; got_name = true;
restart_loop = true; *dt &= ~HEAD_ONLY;
} count = 0; /* the retrieve count for HEAD is reset */
continue;
got_head = true; /* no more time-stamping */ } /* send_head_first */
*dt &= ~HEAD_ONLY; } /* !got_head */
count = 0; /* the retrieve count for HEAD is reset */
if (restart_loop)
continue;
}
if ((tmr != (time_t) (-1)) if ((tmr != (time_t) (-1))
&& ((hstat.len == hstat.contlen) || && ((hstat.len == hstat.contlen) ||

View File

@ -1221,7 +1221,7 @@ append_char (char ch, struct growable *dest)
enum { enum {
filechr_not_unix = 1, /* unusable on Unix, / and \0 */ filechr_not_unix = 1, /* unusable on Unix, / and \0 */
filechr_not_windows = 2, /* unusable on MSDOS/Windows, one of \|/<>?:*" */ filechr_not_windows = 2, /* unusable on Windows, one of \|/<>?:*" */
filechr_control = 4 /* a control character, e.g. 0-31 */ filechr_control = 4 /* a control character, e.g. 0-31 */
}; };

View File

@ -42,6 +42,9 @@ so, delete this exception statement from your version. */
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
# include <sys/mman.h> # include <sys/mman.h>
#endif #endif
#ifdef HAVE_PROCESS_H
# include <process.h> /* getpid() */
#endif
#ifdef HAVE_UTIME_H #ifdef HAVE_UTIME_H
# include <utime.h> # include <utime.h>
#endif #endif