proxy support for wget retriever
I think the patch is pretty self-explanatory. It adds proxy support
for wget, and additionally, it _requires_ the user to input hostname
and directory.
Could somebody review it and apply (I'm in the NM queue and don't have an
account on debian.org).
--
Tollef Fog Heen
Unix _IS_ user friendly... It's just selective about who its friends are.
? wget-retriever
? foo.txt
? proxy.diff
Index: wget-retriever.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/retriever/wget/wget-retriever.c,v
retrieving revision 1.9
diff -c -r1.9 wget-retriever.c
*** wget-retriever.c 2000/12/13 02:48:05 1.9
--- wget-retriever.c 2000/12/19 10:28:24
***************
*** 2,8 ****
* Retrieve files via busybox wget.
* Copyright 2000 Joey Hess <joeyh@debian.org>, GPL'd
*
- * TODO: proxy support
*/
#include <debconfclient.h>
--- 2,7 ----
***************
*** 21,32 ****
if (argc < 3)
exit(1);
! // TODO: what about ftp?
! debconf->command(debconf, "GET", DEBCONF_BASE "http/hostname", NULL);
! hostname=strdup(debconf->value);
! debconf->command(debconf, "GET", DEBCONF_BASE "http/directory", NULL);
! directory=debconf->value;
!
src=argv[1];
/*
* Intercept requests for a Packages file, and
--- 20,51 ----
if (argc < 3)
exit(1);
! // TODO: what about ftp?
! do {
! debconf->command(debconf, "GET", DEBCONF_BASE "http/hostname", NULL);
! } while ((debconf->value == NULL) || (strcmp("",debconf->value) == 0));
! hostname = strdup(debconf->value);
!
! do {
! debconf->command(debconf, "GET", DEBCONF_BASE "http/directory", NULL);
! } while ((debconf->value == NULL) || (strcmp("",debconf->value) == 0));
! directory = strdup(debconf->value);
!
! /* Proxy is optional - therefore no while() loop */
! debconf->command(debconf, "GET", DEBCONF_BASE "http/proxy", NULL);
!
! if (strcmp(debconf->value,"") == 0) {
! char* tmp;
! tmp = malloc( 11 /* http_proxy= */ + strlen(debconf->value) + 1);
! sprintf(tmp,"http_proxy=%s",debconf->value);
!
! ret = putenv(tmp);
! if (ret == -1) {
! return 1;
! }
! free(tmp);
! }
!
src=argv[1];
/*
* Intercept requests for a Packages file, and
Reply to: