The fetch command in Portfiles

Brent Fulgham bfulg at pacbell.net
Mon Jul 9 20:00:11 PDT 2007


On Jul 9, 2007, at 8:26 AM, Ryan Schmidt wrote:

>
> On Jul 9, 2007, at 09:45, Doug McCorkle wrote:
>
>> The correct fetch.ignore_sslcert command solved my problems. In  
>> regards to the args command I thought I might be able to pass  
>> command line args to the utility that downloads packages. In  
>> MacPorts what is used to download packages? Is it curl?
>
> It is curl, but I don't think there's a way to pass arbitrary  
> arguments to it. I'm not even sure whether it's called as a command- 
> line utility or used as a library. I think if you need some special  
> functionality to download something, then that functionality should  
> be built into MacPorts base and made available via the fetch object,  
> like fetch.ignore_sslcert.

Given that some sites prohibit anything that's not a normal user  
agent, it would be really useful to be able to set an argument for  
setting the user agent to Mozilla or something similar.

As an example, Cenon can't be downloaded normally:

Dwight:~ brent$ curl  http://www.vhf-group.com/vhfInterservice/download/source/Apple/Cenon-3.82.tar.bz2
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>403 Forbidden</TITLE>
</HEAD><BODY>
<H1>Forbidden</H1>
You don't have permission to access /vhfInterservice/download/source/ 
Apple/Cenon-3.82.tar.bz2
on this server.<P>
</BODY></HTML>

But using the useragent argument everything is fine:

Dwight:~ brent$ curl -A Mozilla http://www.vhf-group.com/vhfInterservice/download/source/Apple/Cenon-3.82.tar.bz2
BZh91AY&SY?!????????????????????
?? f?a
?ڎ???j????,??V?T?P???1??W?^? hր???li^???W?zU?\?|!?1Ka??ZU*K`-???????? 
wf?????l͙T'=???=>??蘆3z?sEu?`?]z4GPMJ֪??Fc7???@
[.. etc ...]

Adding a "fetch.user_agent" option would be a huge help.

-Brent


More information about the macports-users mailing list