summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorFrederic Martinsons <frederic.martinsons@gmail.com>2023-03-15 14:40:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-17 17:20:05 +0000
commitee5e6a86fd0d2f81a6a3db4fba7ec5158555e595 (patch)
tree02ec29c630883b3aa162fd885be55f728b74ad2d /bitbake/lib/bb/fetch2
parentdc2ac3ca4f8146e8f75682543596639a537e5695 (diff)
downloadpoky-ee5e6a86fd0d2f81a6a3db4fba7ec5158555e595.tar.gz
bitbake: crate.py: authorize crate url with parameters
This allow to have classic fetch parameters (like destsuffix, sha256, name ...) not being considered by crate fetcher itself (and so mess up its download) Moreover, it allow to overload the name of the downloaded crate (maybe usefull if there is a naming clash between two crates coming from different repositories) (Bitbake rev: 278bd2f1758b8af97552af8d23d16ffb5127a131) Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/crate.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/crate.py b/bitbake/lib/bb/fetch2/crate.py
index f091200dd9..2889e39c73 100644
--- a/bitbake/lib/bb/fetch2/crate.py
+++ b/bitbake/lib/bb/fetch2/crate.py
@@ -56,8 +56,10 @@ class Crate(Wget):
56 if len(parts) < 5: 56 if len(parts) < 5:
57 raise bb.fetch2.ParameterError("Invalid URL: Must be crate://HOST/NAME/VERSION", ud.url) 57 raise bb.fetch2.ParameterError("Invalid URL: Must be crate://HOST/NAME/VERSION", ud.url)
58 58
59 # last field is version 59 # version is expected to be the last token
60 version = parts[len(parts) - 1] 60 # but ignore possible url parameters which will be used
61 # by the top fetcher class
62 version, _, _ = parts[len(parts) -1].partition(";")
61 # second to last field is name 63 # second to last field is name
62 name = parts[len(parts) - 2] 64 name = parts[len(parts) - 2]
63 # host (this is to allow custom crate registries to be specified 65 # host (this is to allow custom crate registries to be specified
@@ -69,7 +71,8 @@ class Crate(Wget):
69 71
70 ud.url = "https://%s/%s/%s/download" % (host, name, version) 72 ud.url = "https://%s/%s/%s/download" % (host, name, version)
71 ud.parm['downloadfilename'] = "%s-%s.crate" % (name, version) 73 ud.parm['downloadfilename'] = "%s-%s.crate" % (name, version)
72 ud.parm['name'] = name 74 if 'name' not in ud.parm:
75 ud.parm['name'] = name
73 76
74 logger.debug2("Fetching %s to %s" % (ud.url, ud.parm['downloadfilename'])) 77 logger.debug2("Fetching %s to %s" % (ud.url, ud.parm['downloadfilename']))
75 78