You are not logged in.

#1 2018-11-30 08:03:11

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 861

How to override curl options in PKGBUILD?

Hi, this is my first experience in writing a PKGBUILD so I apologize in advance for the dumb question. My source file does not have a direct download link, but I checked that it can be downloaded correctly using curl with these options:

curl -JLO https://bintray.com/15knots/p2-zip/download_file?file_path=CMakeEd-1_10_0.zip

However, simply putting:

source=("https://bintray.com/15knots/p2-zip/download_file?file_path=CMakeEd-1_10_0.zip")

in the PKGBUILD gives this error:

curl: (22) The requested URL returned error: 404 Not Found
==> ERROR: Failure while downloading https://bintray.com/15knots/p2-zip/download_file?file_path=CMakeEd-1_10_0.zip
    Aborting...

when running makepkg. So I guess that curl is invoked with different options. Is there a way to override the curl options with -JLO in the PKGBUILD?
Thanks.

Offline

#2 2018-11-30 10:05:10

Piri
Member
Registered: 2018-06-02
Posts: 70

Re: How to override curl options in PKGBUILD?

curl -JLO https://bintray.com/15knots/p2-zip/download_file?file_path=CMakeEd-1_10_0.zip

Just downloads you the broken HTML page. On bintray you want to use dl.bintray.com links like this:

https://dl.bintray.com/15knots/p2-zip/CMakeEd-1.10.0.zip

Offline

#3 2018-11-30 10:48:34

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 861

Re: How to override curl options in PKGBUILD?

Piri wrote:
curl -JLO https://bintray.com/15knots/p2-zip/download_file?file_path=CMakeEd-1_10_0.zip

Just downloads you the broken HTML page. On bintray you want to use dl.bintray.com links like this:

https://dl.bintray.com/15knots/p2-zip/CMakeEd-1.10.0.zip

Yes, sorry I put a wrong link on my initial post: the file name had underscores instead of points. I fixed it, also in the PKGBUILD, and now makepkg downloads the correct file but saves it with a wrong name: download_file?file_path=CMakeEd-1.10.0.zip. Using your direct download link instead everything works. Thanks!!

Last edited by snack (2018-11-30 10:49:06)

Offline

#4 2018-11-30 12:38:48

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: How to override curl options in PKGBUILD?

You can override the filename. See

man PKGBUILD | less -p "source \(array\)"

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB