Opened 10 years ago

Closed 8 years ago

#53942 closed update (fixed)

generaluser-soundfont: update to 1.471

Reported by: mojca (Mojca Miklavec) Owned by: RJVB (René Bertin)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: generaluser-soundfont

Description

GeneralUser has been updated, but the regular link under

no longer works for me.

The link

or rather:

does, but only conditionally. In any case I'm unable to convince MacPorts to download the file.

I tried following ​PortfileRecipes and used

master_sites        https://www.dropbox.com/s/4x27l49kxcwamp5/${distfiles}?dl=1&dummy=

but all I can get is some HTML page requesting accepting cookies.

Change History (8)

comment:1 Changed 10 years ago by RJVB (René Bertin)

Have you tried wget "https://www.dropbox.com/s/4x27l49kxcwamp5/GeneralUser_GS_1.471.zip"? That works for me, from the commandline.

As a temporary measure, would it be possible to download the archive manually and install it on the MacPorts mirrors so clients will download it from there?

Last edited 10 years ago by RJVB (René Bertin) (previous) (diff)

comment:2 Changed 10 years ago by RJVB (René Bertin)

This works for me:

master_sites        https://www.dropbox.com/s/4x27l49kxcwamp5/

fetch {
    system "wget ${master_sites}/${distname}${extract.suffix} --progress=bar:force -O ${distpath}/${distname}${extract.suffix}"
}

checksums           rmd160  aa8eabb515b0e27ff94b05b6be30ac7e1afc0414 \
                    sha256  4203835164766f428c4926c097c9ea58dae431c7fb8f9dbe277b92d80da45ec2

comment:3 Changed 8 years ago by slewsys (Andrew L. Moore)

In e5a420ccf2ea47e8264ca8a68d899369370317bb/macports-base (master):

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
#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.

comment:4 Changed 8 years ago by jmroot (Joshua Root)

As suggested in comment:2, you can override the fetch phase and run whatever arbitrary commands you need to, so if this is not available for download from any better-behaved server, you can go that direction. I would avoid wget though since it doesn't come with the OS and so requires an extra dependency.

comment:5 Changed 8 years ago by RJVB (René Bertin)

You're not wrong about that. I honestly cannot remember if using curl directly solved the issue (I do remember that I never know how to use that command properly; wget is so much more user-friendly, to me at least).

Mojca's proposal for fetch.user_agent does make sense, but as always with adding features to base, it would make the port break for anyone who for some reason cannot update.

comment:6 Changed 8 years ago by jmroot (Joshua Root)

No need, this works:

master_sites        https://www.dropbox.com/s/4x27l49kxcwamp5/${distfiles}?raw=1&dummy=

i.e. the magic needed is raw=1 rather than dl=1.

comment:7 Changed 8 years ago by jmroot (Joshua Root)

Or this works even better:

master_sites        https://dl.dropbox.com/s/4x27l49kxcwamp5/

comment:8 Changed 8 years ago by mojca (Mojca Miklavec)

Resolution: → fixed
Status: new → closed
Note: See TracTickets for help on using tickets.