diff options
| author | Ross Burton <ross.burton@intel.com> | 2015-11-20 15:34:52 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:32:01 +0000 |
| commit | 6ea39c26b75c0ac48c0865cf18f2b9bd6bc91132 (patch) | |
| tree | 669107171e96dbeedf83de93e6eed6f2c8550042 | |
| parent | eded9c26b379baefdc9ad49f856615b6e7e36760 (diff) | |
| download | poky-6ea39c26b75c0ac48c0865cf18f2b9bd6bc91132.tar.gz | |
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.
(From OE-Core rev: a98a14844bc0b2ef8fc0426768fde40516279bf8)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/base.bbclass | 67 |
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 () { | |||
| 527 | bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS") | 527 | bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS") |
| 528 | 528 | ||
| 529 | srcuri = d.getVar('SRC_URI', True) | 529 | srcuri = d.getVar('SRC_URI', True) |
| 530 | # Svn packages should DEPEND on subversion-native | 530 | for uri in srcuri.split(): |
| 531 | if "svn://" in srcuri: | 531 | (scheme, _ , path) = bb.fetch.decodeurl(uri)[:3] |
| 532 | d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot') | 532 | |
| 533 | 533 | # Svn packages should DEPEND on subversion-native | |
| 534 | # Git packages should DEPEND on git-native | 534 | if scheme == "svn": |
| 535 | if "git://" in srcuri: | 535 | d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot') |
| 536 | d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot') | 536 | |
| 537 | 537 | # Git packages should DEPEND on git-native | |
| 538 | # Mercurial packages should DEPEND on mercurial-native | 538 | elif scheme == "git": |
| 539 | elif "hg://" in srcuri: | 539 | d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot') |
| 540 | d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot') | 540 | |
| 541 | 541 | # Mercurial packages should DEPEND on mercurial-native | |
| 542 | # OSC packages should DEPEND on osc-native | 542 | elif scheme == "hg": |
| 543 | elif "osc://" in srcuri: | 543 | d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot') |
| 544 | d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot') | 544 | |
| 545 | 545 | # OSC packages should DEPEND on osc-native | |
| 546 | # *.lz4 should depends on lz4-native for unpacking | 546 | elif scheme == "osc": |
| 547 | # Not endswith because of "*.patch.lz4;patch=1". Need bb.fetch.decodeurl in future | 547 | d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot') |
| 548 | if '.lz4' in srcuri: | 548 | |
| 549 | d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot') | 549 | # *.lz4 should DEPEND on lz4-native for unpacking |
| 550 | 550 | if path.endswith('.lz4'): | |
| 551 | # *.xz should depends on xz-native for unpacking | 551 | d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot') |
| 552 | # Not endswith because of "*.patch.xz;patch=1". Need bb.fetch.decodeurl in future | 552 | |
| 553 | if '.xz' in srcuri: | 553 | # *.xz should DEPEND on xz-native for unpacking |
| 554 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') | 554 | elif path.endswith('.xz'): |
| 555 | 555 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') | |
| 556 | # unzip-native should already be staged before unpacking ZIP recipes | 556 | |
| 557 | if ".zip" in srcuri: | 557 | # .zip should DEPEND on unzip-native for unpacking |
| 558 | d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot') | 558 | elif path.endswith('.zip'): |
| 559 | 559 | d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot') | |
| 560 | # file is needed by rpm2cpio.sh | 560 | |
| 561 | if ".src.rpm" in srcuri: | 561 | # file is needed by rpm2cpio.sh |
| 562 | d.appendVarFlag('do_unpack', 'depends', ' file-native:do_populate_sysroot') | 562 | elif path.endswith('.src.rpm'): |
| 563 | d.appendVarFlag('do_unpack', 'depends', ' file-native:do_populate_sysroot') | ||
| 563 | 564 | ||
| 564 | set_packagetriplet(d) | 565 | set_packagetriplet(d) |
| 565 | 566 | ||
