You are not logged in.

#1 2015-12-30 12:45:04

Chais
Member
Registered: 2011-08-08
Posts: 33

[SOLVED] Let makepkg first log in then download sources

The page hosting the files for a package I'm maintaining migrated to requiring a login for downloading the files. I figured out how to log in with curl and save the cookie, then download the file using that cookie. However it's impossible to fuse both steps into one, as the form doesn't return the file.
Currently I'm considering two solutions:

1. Create an indefinitely valid cookie and include it is the sources. This has the upshot of not exposing the login password in the PKGBUILD but bears the risk of the session being invalidated for some reason which would require me to update the package. Also I don't know if this is accepted for the AUR.
2. Let makepkg use curl to create its own session cookie before downloading the sources. This requires the login credentials to be stored in the PKGBUILD.

I'm not sure which solution is better. They both have their upsides and downsides. I'm not sure if 2 is even possible, but if someone knows a way, please tell me.
Also I'm open for opinions on which solution is preferable.

Last edited by Chais (2015-12-30 14:04:37)


--
Chais

Offline

#2 2015-12-30 12:57:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,520
Website

Re: [SOLVED] Let makepkg first log in then download sources

2 is possible.  You can run various commands in a prepare function to get the sources.  This is how all VCS sources used to be handled.

However, this sounds like you are trying to circumvent the restrictions of the author/upstream provider.  This is most definitely not allowed.  Many AUR packages require that the user download the source file manually, and the PKGBUILD will list a local file in the source array.  This would be my suggestion.

Would you mind providing links to the upstream source so I can check (and possibly rule out) my concerns about their restrictions?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#3 2015-12-30 13:02:14

Chais
Member
Registered: 2011-08-08
Posts: 33

Re: [SOLVED] Let makepkg first log in then download sources

Ah ok. I wasn't aware that prepare() was run before the source is even downloaded. The files are available here: http://www.fmod.org/download-previous-products/


--
Chais

Offline

#4 2015-12-30 13:03:59

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [SOLVED] Let makepkg first log in then download sources

In my opinion both are a bad idea , the owner of those files has a reason why they require a login to download.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2015-12-30 13:06:53

Chais
Member
Registered: 2011-08-08
Posts: 33

Re: [SOLVED] Let makepkg first log in then download sources

Lone_Wolf wrote:

[...] the owner of those files has a reason why they require a login to download.

IMO the reason may just be gathering data. Probably for market research.


--
Chais

Offline

#6 2015-12-30 13:47:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,520
Website

Re: [SOLVED] Let makepkg first log in then download sources

You may be right, but however one may feel about their desire to conduct such market research it is there prerogative.

Circumventing this may or may not be illegal, but it is definitely not ethical.  Please just let users of the PKGBUILD download the source files themselves.  There are many examples of packages like this in the AUR.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#7 2015-12-30 14:04:19

Chais
Member
Registered: 2011-08-08
Posts: 33

Re: [SOLVED] Let makepkg first log in then download sources

Ok


--
Chais

Offline

Board footer

Powered by FluxBB