All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/7] fetch2/wget: consider downloadfilename when checking for upstream
@ 2025-03-26 12:25 Ross Burton
  2025-03-26 12:25 ` [PATCH v3 2/7] fetch2/wget: don't conditionalise --continue Ross Burton
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Ross Burton @ 2025-03-26 12:25 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 bitbake/lib/bb/fetch2/wget.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 6cb728ab43c..df3e649312f 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -650,13 +650,17 @@ class Wget(FetchMethod):
 
         sanity check to ensure same name and type.
         """
-        package = ud.path.split("/")[-1]
+        if 'downloadfilename' in ud.parm:
+            package = ud.parm['downloadfilename']
+        else:
+            package = ud.path.split("/")[-1]
         current_version = ['', d.getVar('PV'), '']
 
         """possible to have no version in pkg name, such as spectrum-fw"""
         if not re.search(r"\d+", package):
             current_version[1] = re.sub('_', '.', current_version[1])
             current_version[1] = re.sub('-', '.', current_version[1])
+            bb.debug(3, "latest_versionstring: no version found in %s" % package)
             return (current_version[1], '')
 
         package_regex = self._init_regexes(package, ud, d)
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-03-27 13:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 12:25 [PATCH v3 1/7] fetch2/wget: consider downloadfilename when checking for upstream Ross Burton
2025-03-26 12:25 ` [PATCH v3 2/7] fetch2/wget: don't conditionalise --continue Ross Burton
2025-03-26 12:25 ` [PATCH v3 3/7] fetch2/wget: use long arguments for clarity Ross Burton
2025-03-26 12:25 ` [PATCH v3 4/7] bb/tests: use subtests when looping in a test case Ross Burton
2025-03-26 12:25 ` [PATCH v3 5/7] tests/fetch: use a namedtuple for the wget test data Ross Burton
2025-03-26 12:25 ` [PATCH v3 6/7] tests/fetch: support setting PV in the wget fetcher Ross Burton
2025-03-26 12:25 ` [PATCH v3 7/7] tests/fetch: add a test for download paths without a proper filename Ross Burton
2025-03-27 13:17 ` [bitbake-devel] [PATCH v3 1/7] fetch2/wget: consider downloadfilename when checking for upstream Mathieu Dubois-Briand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.