summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-11-20 15:34:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-01 21:07:20 +0000
commita98a14844bc0b2ef8fc0426768fde40516279bf8 (patch)
tree53eb46098db52c0fa551bf6f838fb53116805444
parent97f77ea3313b0d79ae4a6090672a2a9344282262 (diff)
downloadopenembedded-core-a98a14844bc0b2ef8fc0426768fde40516279bf8.tar.gz
openembedded-core-a98a14844bc0b2ef8fc0426768fde40516279bf8.tar.bz2
openembedded-core-a98a14844bc0b2ef8fc0426768fde40516279bf8.zip
base: decode SRC_URI before adding implicit fetch dependencies
To avoid false positives such as a SRC_URI for http://foo.xz/foo.zip gaining a dependnecy on xz-native decode the URI so that precise tests can be done. Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/base.bbclass67
1 files changed, 34 insertions, 33 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index eb5edef3b3..64820a75b1 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -527,39 +527,40 @@ python () {
bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS")
srcuri = d.getVar('SRC_URI', True)
- # Svn packages should DEPEND on subversion-native
- if "svn://" in srcuri:
- d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot')
-
- # Git packages should DEPEND on git-native
- if "git://" in srcuri:
- d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot')
-
- # Mercurial packages should DEPEND on mercurial-native
- elif "hg://" in srcuri:
- d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot')
-
- # OSC packages should DEPEND on osc-native
- elif "osc://" in srcuri:
- d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot')
-
- # *.lz4 should depends on lz4-native for unpacking
- # Not endswith because of "*.patch.lz4;patch=1". Need bb.fetch.decodeurl in future
- if '.lz4' in srcuri:
- d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot')
-
- # *.xz should depends on xz-native for unpacking
- # Not endswith because of "*.patch.xz;patch=1". Need bb.fetch.decodeurl in future
- if '.xz' in srcuri:
- d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
-
- # unzip-native should already be staged before unpacking ZIP recipes
- if ".zip" in srcuri:
- d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
-
- # file is needed by rpm2cpio.sh
- if ".src.rpm" in srcuri:
- d.appendVarFlag('do_unpack', 'depends', ' file-native:do_populate_sysroot')
+ for uri in srcuri.split():
+ (scheme, _ , path) = bb.fetch.decodeurl(uri)[:3]
+
+ # Svn packages should DEPEND on subversion-native
+ if scheme == "svn":
+ d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot')
+
+ # Git packages should DEPEND on git-native
+ elif scheme == "git":
+ d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot')
+
+ # Mercurial packages should DEPEND on mercurial-native
+ elif scheme == "hg":
+ d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot')
+
+ # OSC packages should DEPEND on osc-native
+ elif scheme == "osc":
+ d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot')
+
+ # *.lz4 should DEPEND on lz4-native for unpacking
+ if path.endswith('.lz4'):
+ d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot')
+
+ # *.xz should DEPEND on xz-native for unpacking
+ elif path.endswith('.xz'):
+ d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+
+ # .zip should DEPEND on unzip-native for unpacking
+ elif path.endswith('.zip'):
+ d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
+
+ # file is needed by rpm2cpio.sh
+ elif path.endswith('.src.rpm'):
+ d.appendVarFlag('do_unpack', 'depends', ' file-native:do_populate_sysroot')
set_packagetriplet(d)