You are not logged in.

#1 2017-01-13 19:46:40

Omar007
Member
Registered: 2015-04-09
Posts: 368

[Solved] Adapt source downloader to include Referer header

One of my packages was flagged as out of date (https://aur.archlinux.org/packages/spflashtool-bin/) and the provided link in the flag message ends up on the URL that was once mentioned before.
As such I decided to change the package to make use of this site instead since it actually has new versions available and actually adds new ones over time.

In this process I hit a few bumps though.. Could I get some advice on the following points?
1) the new source file can not be downloaded without setting the 'Referer' header. How do I accomplish this in a PKGBUILD?
2) the new source does not provide 32-bit binaries. Should I somehow handle the fact that the package suddenly drops i686 as architecture or will users just have to deal with it?

Last edited by Omar007 (2017-01-13 22:30:16)

Offline

#2 2017-01-13 20:48:20

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] Adapt source downloader to include Referer header

According to that newer page, it isn't even their tool: "Credits: Smart Phone Flash Tool is created by MediaTek Inc, So full copyright and credits goes to them. Here, we have just shared the tool, as it was available for free." So maybe look for a better download location???

Last edited by eschwartz (2017-01-13 21:07:04)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-01-13 21:25:14

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: [Solved] Adapt source downloader to include Referer header

I did try to find something that is more 'upstream' but I kept routing back to either my original source or the one supplied in the flag message hmm
As a result I do not really see any other options available to me in regards to updating this package. If you have a better alternative I'll gladly take it.

In the meantime, I read the makepkg.conf file manpage and found information regarding a DLAGENTS variable so I'm currently checking if I can use that.

EDIT: This solves the referer problem by overriding the DLAGENTS entry for http

DLAGENTS=('http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -e %u -o %o %u'
          "${DLAGENTS[@]}")

Last edited by Omar007 (2017-01-13 21:51:33)

Offline

#4 2017-01-13 21:57:31

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [Solved] Adapt source downloader to include Referer header

Omar007 wrote:

2) the new source does not provide 32-bit binaries. Should I somehow handle the fact that the package suddenly drops i686 as architecture or will users just have to deal with it?

arch=('x86_64')

edit: and then just one source array without architecture suffix.

Last edited by mis (2017-01-13 22:04:52)

Offline

#5 2017-01-13 22:29:26

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: [Solved] Adapt source downloader to include Referer header

That's what I did. And as it turns out, it seems the 32bit version may not have even worked properly at all so I don't think anyone ever used it otherwise I'd probably have heard something about that.

Anyway, I've updated the package. Marking thread as solved smile

Last edited by Omar007 (2017-01-13 22:30:06)

Offline

Board footer

Powered by FluxBB