Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
portfetch.tcl: Add option fetch.user_agent.
When MacPorts attempts to fetch from DropBox, it gets HTML instead of the requested file. This is because MacPorts sets libcurl's User-Agent header in curl.c to "MacPorts/MP_VERSION libcurl/LC_VERSION", which DropBox responds to as a web brower. The problem was first reported in https://trac.macports.org/ticket/53942 with regard to port audio/generaluser-soundfont. This PR adds an option `fetch.user_agent' which can be set in Portfile as needed. For example, in audio/generaluser-soundfont/Portfile, adding: fetch.user_agent curl/MacPorts/4.xx allows fetch to work without a custom fetch block. If `fetch.user_agent' is not set, UserAgent as defined in curl.c is used instead. In the particular case of DropBox, setting the User-Agent header to "libcurl/..." doesn't work as one might hope, otherwise swapping the order of values in curl.c UserAgent variable would be suggested as an alternative.
- Loading branch information