[csw-users] pkg-get help

James Lee james at blastwave.org
Wed Nov 8 17:03:59 CET 2006


On 08/11/06, 15:22:10, Oldwen Adriano <oldwenstyle at yahoo.com> wrote 
regarding [csw-users] pkg-get help:

> -- SunOS 5.8
> -- Server does not have DNS.  I can ping any IP, but I can not resolve 
names    (www.google.com)
> -- I have tried url=http://128.210.3.14/mirrors/blastwave.org/unstable/



$ curl -I 
http://128.210.3.14/mirrors/blastwave.org/unstable/sparc/5.8/catalog
HTTP/1.1 404 Not Found
Date: Wed, 08 Nov 2006 15:56:42 GMT
Server: Apache
Content-Type: text/html

So that is not going to work.  The reason is because the server uses the
host name to decide what to do.  How to set the host header?  First test
again with curl:

$ curl -I -H "Host:ftp.math.purdue.edu" 
http://128.210.3.14/mirrors/blastwave.org/unstable/sparc/5.8/catalog
HTTP/1.1 200 OK
Date: Wed, 08 Nov 2006 15:56:51 GMT
Server: Apache
Last-Modified: Fri, 03 Nov 2006 20:54:38 GMT
ETag: "c85c-2e874-454bac8e"
Accept-Ranges: bytes
Content-Length: 190580
Content-Type: text/plain


Good, now with wget:


$ wget --header="Host:ftp.math.purdue.edu" 
http://128.210.3.14/mirrors/blastwave.org/unstable/sparc/5.8/catalog -O 
/dev/null

--15:57:43--  
http://128.210.3.14/mirrors/blastwave.org/unstable/sparc/5.8/catalog
           => `/dev/null'
Connecting to 128.210.3.14:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 190,580 (186K) [text/plain]

100%[===================================================================
=============>] 190,580      103.00K/s             

15:57:45 (102.93 KB/s) - `/dev/null' saved [190580/190580]


you get make pkg-get use this by setting WGET:
$ WGET="wget --header=Host:ftp.math.purdue.edu"
$ export WGET

$ $WGET 
http://128.210.3.14/mirrors/blastwave.org/unstable/sparc/5.8/catalog -O 
/dev/null
--16:00:45--  
http://128.210.3.14/mirrors/blastwave.org/unstable/sparc/5.8/catalog
           => `/dev/null'
Connecting to 128.210.3.14:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 190,580 (186K) [text/plain]

100%[===================================================================
=============>] 190,580      104.68K/s             

15:58:32 (104.36 KB/s) - `/dev/null' saved [190580/190580]



Or it would be better specifically in the url setting (untested by
me, please try it):

url="--header=Host:ftp.math.purdue.edu 
http://128.210.3.14/mirrors/blastwave.org/unstable/"







More information about the users mailing list