mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-11 09:48:24 +02:00
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
60
src/patches/busybox-0.60.5-spider.patch
Normal file
60
src/patches/busybox-0.60.5-spider.patch
Normal file
@@ -0,0 +1,60 @@
|
||||
diff -u busybox-0.60.5.old/usage.h busybox-0.60.5/usage.h
|
||||
--- busybox-0.60.5.old/usage.h 2002-09-30 21:59:58.000000000 +0100
|
||||
+++ busybox-0.60.5/usage.h 2004-01-16 00:42:40.000000000 +0000
|
||||
@@ -1901,12 +1901,13 @@
|
||||
" 31 46 1365 /etc/passwd\n"
|
||||
|
||||
#define wget_trivial_usage \
|
||||
- "[-c|--continue] [-q|--quiet] [-O|--output-document file]\n\t[--header 'header: value'] [-P DIR] url"
|
||||
+ "[-c|--continue] [-q|--quiet] [-s|--spider] [-O|--output-document file]\n\t[--header 'header: value'] [-P DIR] url"
|
||||
#define wget_full_usage \
|
||||
"wget retrieves files via HTTP or FTP\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-c\tcontinue retrieval of aborted transfers\n" \
|
||||
"\t-q\tquiet mode - do not print\n" \
|
||||
+ "\t-s\tspider mode - check file exists\n" \
|
||||
"\t-P\tSet directory prefix to DIR\n" \
|
||||
"\t-O\tsave to filename ('-' for stdout)"
|
||||
|
||||
diff -u busybox-0.60.5.old/wget.c busybox-0.60.5/wget.c
|
||||
--- busybox-0.60.5.old/wget.c 2002-04-27 08:40:00.000000000 +0100
|
||||
+++ busybox-0.60.5/wget.c 2004-01-16 00:47:47.000000000 +0000
|
||||
@@ -179,6 +179,7 @@
|
||||
int got_clen = 0; /* got content-length: from server */
|
||||
FILE *output; /* socket to web server */
|
||||
int quiet_flag = FALSE; /* Be verry, verry quiet... */
|
||||
+ int spider = FALSE; /* Just check file exists (-s) */
|
||||
|
||||
#define LONG_HEADER 1
|
||||
struct option long_options[] = {
|
||||
@@ -186,16 +187,20 @@
|
||||
{ "quiet", 0, NULL, 'q' },
|
||||
{ "output-document", 1, NULL, 'O' },
|
||||
{ "header", 1, &which_long_opt, LONG_HEADER },
|
||||
+ { "spider", 0, NULL, 's' },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
/*
|
||||
* Crack command line.
|
||||
*/
|
||||
- while ((n = getopt_long(argc, argv, "cqO:P:", long_options, &option_index)) != EOF) {
|
||||
+ while ((n = getopt_long(argc, argv, "cqsO:P:", long_options, &option_index)) != EOF) {
|
||||
switch (n) {
|
||||
case 'c':
|
||||
++do_continue;
|
||||
break;
|
||||
+ case 's':
|
||||
+ spider = TRUE;
|
||||
+ break;
|
||||
case 'P':
|
||||
dir_prefix = optarg;
|
||||
break;
|
||||
@@ -353,6 +358,8 @@
|
||||
while (gethdr(buf, sizeof(buf), sfp, &n) != NULL);
|
||||
goto read_response;
|
||||
case 200:
|
||||
+ if (spider)
|
||||
+ exit(EXIT_SUCCESS);
|
||||
if (do_continue && output != stdout)
|
||||
output = freopen(fname_out, "w", output);
|
||||
do_continue = 0;
|
||||
Reference in New Issue
Block a user