summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2024-02-20 10:48:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-20 12:56:40 +0000
commit730bd999d641301d46159b4dbbcafa87bbc950fc (patch)
tree8cec70a3555c2f6d6112d975c8f54b94e713d467
parent468e55069219310f2ae14bc89c6fdf4fa6f3ee06 (diff)
downloadpoky-730bd999d641301d46159b4dbbcafa87bbc950fc.tar.gz
bitbake: Revert "bitbake: wget.py: always use the custom user agent"
This reverts commit 987ab2a446aab235d6e86e97c05f25fb800d7acc. 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>
-rw-r--r--bitbake/lib/bb/fetch2/wget.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index bb38dd4358..dc025800e6 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -87,8 +87,7 @@ class Wget(FetchMethod):
87 if not ud.localfile: 87 if not ud.localfile:
88 ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", ".")) 88 ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."))
89 89
90 self.basecmd = d.getVar("FETCHCMD_wget") \ 90 self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 30 --passive-ftp"
91 or "/usr/bin/env wget -t 2 -T 30 --passive-ftp --user-agent='%s'" % (self.user_agent)
92 91
93 if not self.check_certs(d): 92 if not self.check_certs(d):
94 self.basecmd += " --no-check-certificate" 93 self.basecmd += " --no-check-certificate"
@@ -455,7 +454,7 @@ class Wget(FetchMethod):
455 f = tempfile.NamedTemporaryFile() 454 f = tempfile.NamedTemporaryFile()
456 with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f: 455 with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f:
457 fetchcmd = self.basecmd 456 fetchcmd = self.basecmd
458 fetchcmd += " -O " + f.name + " '" + uri + "'" 457 fetchcmd += " -O " + f.name + " --user-agent='" + self.user_agent + "' '" + uri + "'"
459 try: 458 try:
460 self._runwget(ud, d, fetchcmd, True, workdir=workdir) 459 self._runwget(ud, d, fetchcmd, True, workdir=workdir)
461 fetchresult = f.read() 460 fetchresult = f.read()
@@ -493,7 +492,7 @@ class Wget(FetchMethod):
493 valid = 1 492 valid = 1
494 elif self._vercmp(version, newver) < 0: 493 elif self._vercmp(version, newver) < 0:
495 version = newver 494 version = newver
496 495
497 pupver = re.sub('_', '.', version[1]) 496 pupver = re.sub('_', '.', version[1])
498 497
499 bb.debug(3, "*** %s -> UpstreamVersion = %s (CurrentVersion = %s)" % 498 bb.debug(3, "*** %s -> UpstreamVersion = %s (CurrentVersion = %s)" %