mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
bitbake: Revert "bitbake: wget.py: always use the custom user agent"
This reverts commit 987ab2a446.
There's been a report that this breaks downloads from Jfrog Artifactory
as self.user_agent is set to 'Mozilla Firefox', and when Artifactory
sees that, it sends a response tailored for showing in an interactive browser
(which in my opinion it has every right to).
If we're using wget, we should say so via wget's default; handling uncooperative
servers should be done on per-recipe basis, and ideally with tickets
to admins of those servers.
(Bitbake rev: feef5cd12e877f42ffcace168d44b0e6eb80a907)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
468e550692
commit
730bd999d6
@@ -87,8 +87,7 @@ class Wget(FetchMethod):
|
|||||||
if not ud.localfile:
|
if not ud.localfile:
|
||||||
ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."))
|
ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."))
|
||||||
|
|
||||||
self.basecmd = d.getVar("FETCHCMD_wget") \
|
self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 30 --passive-ftp"
|
||||||
or "/usr/bin/env wget -t 2 -T 30 --passive-ftp --user-agent='%s'" % (self.user_agent)
|
|
||||||
|
|
||||||
if not self.check_certs(d):
|
if not self.check_certs(d):
|
||||||
self.basecmd += " --no-check-certificate"
|
self.basecmd += " --no-check-certificate"
|
||||||
@@ -455,7 +454,7 @@ class Wget(FetchMethod):
|
|||||||
f = tempfile.NamedTemporaryFile()
|
f = tempfile.NamedTemporaryFile()
|
||||||
with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f:
|
with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f:
|
||||||
fetchcmd = self.basecmd
|
fetchcmd = self.basecmd
|
||||||
fetchcmd += " -O " + f.name + " '" + uri + "'"
|
fetchcmd += " -O " + f.name + " --user-agent='" + self.user_agent + "' '" + uri + "'"
|
||||||
try:
|
try:
|
||||||
self._runwget(ud, d, fetchcmd, True, workdir=workdir)
|
self._runwget(ud, d, fetchcmd, True, workdir=workdir)
|
||||||
fetchresult = f.read()
|
fetchresult = f.read()
|
||||||
|
|||||||
Reference in New Issue
Block a user