summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-03-26 12:25:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-27 13:40:31 +0000
commitf976a7d4fba6e432c48e2534b70d01dc36b6702f (patch)
tree2636d5e990e649df171dc1dba0f47e41512358ed /bitbake
parentc00ad319d49537e3277fcf70196eec534a958959 (diff)
downloadpoky-f976a7d4fba6e432c48e2534b70d01dc36b6702f.tar.gz
bitbake: fetch2/wget: consider downloadfilename when checking for upstream
latest_versionstring() currently looks at just the end of the URI when guessing what the filename to look for is, but this doesn't work if the URL filename is not simple. For example, miniupnpd has a SRC_URI of: http://miniupnp.tuxfamily.org/files/download.php?file=${BP}.tar.gz;downloadfilename=${BP}.tar.gz The filename component of this is "download.php", which causes the heuristics in latest_versionstring() to exit early. Instead, if the downloadfilename is set then use that, as it's often the actual filename that we're after. (Bitbake rev: 2d5f135e997d13fabda0ad266fd5c928ee33f487) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/wget.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 6cb728ab43..df3e649312 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -650,13 +650,17 @@ class Wget(FetchMethod):
650 650
651 sanity check to ensure same name and type. 651 sanity check to ensure same name and type.
652 """ 652 """
653 package = ud.path.split("/")[-1] 653 if 'downloadfilename' in ud.parm:
654 package = ud.parm['downloadfilename']
655 else:
656 package = ud.path.split("/")[-1]
654 current_version = ['', d.getVar('PV'), ''] 657 current_version = ['', d.getVar('PV'), '']
655 658
656 """possible to have no version in pkg name, such as spectrum-fw""" 659 """possible to have no version in pkg name, such as spectrum-fw"""
657 if not re.search(r"\d+", package): 660 if not re.search(r"\d+", package):
658 current_version[1] = re.sub('_', '.', current_version[1]) 661 current_version[1] = re.sub('_', '.', current_version[1])
659 current_version[1] = re.sub('-', '.', current_version[1]) 662 current_version[1] = re.sub('-', '.', current_version[1])
663 bb.debug(3, "latest_versionstring: no version found in %s" % package)
660 return (current_version[1], '') 664 return (current_version[1], '')
661 665
662 package_regex = self._init_regexes(package, ud, d) 666 package_regex = self._init_regexes(package, ud, d)