summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-01-21 16:09:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-23 17:08:49 +0000
commit5cd396c099730b765fc6cd82e2d7748f99de7157 (patch)
tree84b76ff7be60af5081f267385ce4d2f46dcc3c1c
parent19ddacc1b38f9ebb86a9359963ccc3c707f7125e (diff)
downloadopenembedded-core-5cd396c099730b765fc6cd82e2d7748f99de7157.tar.gz
base: use URI instead of decodeurl when detecting unpack dependencies
decodeurl() has limitations, primarily that it doesn't handle query parameters at all. If a SRC_URI looks like this: http://example.com/download.tar.gz?something Then the returned path attribute is download.tar.gz?something. This means the filename extension detection fails and required tools are not added to the dependencies. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass30
1 files changed, 15 insertions, 15 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 78ae28bb0f..d287065e08 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -596,62 +596,62 @@ python () {
needsrcrev = False
srcuri = d.getVar('SRC_URI')
- for uri in srcuri.split():
- (scheme, _ , path) = bb.fetch.decodeurl(uri)[:3]
+ for uri_string in srcuri.split():
+ uri = bb.fetch.URI(uri_string)
# HTTP/FTP use the wget fetcher
- if scheme in ("http", "https", "ftp"):
+ if uri.scheme in ("http", "https", "ftp"):
d.appendVarFlag('do_fetch', 'depends', ' wget-native:do_populate_sysroot')
# Svn packages should DEPEND on subversion-native
- if scheme == "svn":
+ if uri.scheme == "svn":
needsrcrev = True
d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot')
# Git packages should DEPEND on git-native
- elif scheme in ("git", "gitsm"):
+ elif uri.scheme in ("git", "gitsm"):
needsrcrev = True
d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot')
# Mercurial packages should DEPEND on mercurial-native
- elif scheme == "hg":
+ elif uri.scheme == "hg":
needsrcrev = True
d.appendVar("EXTRANATIVEPATH", ' python3-native ')
d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot')
# Perforce packages support SRCREV = "${AUTOREV}"
- elif scheme == "p4":
+ elif uri.scheme == "p4":
needsrcrev = True
# OSC packages should DEPEND on osc-native
- elif scheme == "osc":
+ elif uri.scheme == "osc":
d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot')
- elif scheme == "npm":
+ elif uri.scheme == "npm":
d.appendVarFlag('do_fetch', 'depends', ' nodejs-native:do_populate_sysroot')
# *.lz4 should DEPEND on lz4-native for unpacking
- if path.endswith('.lz4'):
+ if uri.path.endswith('.lz4'):
d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot')
# *.lz should DEPEND on lzip-native for unpacking
- elif path.endswith('.lz'):
+ elif uri.path.endswith('.lz'):
d.appendVarFlag('do_unpack', 'depends', ' lzip-native:do_populate_sysroot')
# *.xz should DEPEND on xz-native for unpacking
- elif path.endswith('.xz') or path.endswith('.txz'):
+ elif uri.path.endswith('.xz') or uri.path.endswith('.txz'):
d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
# .zip should DEPEND on unzip-native for unpacking
- elif path.endswith('.zip') or path.endswith('.jar'):
+ elif uri.path.endswith('.zip') or uri.path.endswith('.jar'):
d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
# Some rpm files may be compressed internally using xz (for example, rpms from Fedora)
- elif path.endswith('.rpm'):
+ elif uri.path.endswith('.rpm'):
d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
# *.deb should DEPEND on xz-native for unpacking
- elif path.endswith('.deb'):
+ elif uri.path.endswith('.deb'):
d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
if needsrcrev: