diff options
author | Ross Burton <ross@burtonini.com> | 2021-01-21 16:09:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-21 23:25:53 +0000 |
commit | 85335647a316230ad78520955ba738f08c334659 (patch) | |
tree | 9ba77e8e4b28ead84a701f3d0fa77e8bd473e328 | |
parent | dbdf5e69a82789e2be358bfaa17e212a3a688cd9 (diff) | |
download | poky-85335647a316230ad78520955ba738f08c334659.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.
(From OE-Core rev: 4897fc31e533a3e7d20b54c2b039e0143d22c28f)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/base.bbclass | 30 |
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 () { | |||
596 | 596 | ||
597 | needsrcrev = False | 597 | needsrcrev = False |
598 | srcuri = d.getVar('SRC_URI') | 598 | srcuri = d.getVar('SRC_URI') |
599 | for uri in srcuri.split(): | 599 | for uri_string in srcuri.split(): |
600 | (scheme, _ , path) = bb.fetch.decodeurl(uri)[:3] | 600 | uri = bb.fetch.URI(uri_string) |
601 | 601 | ||
602 | # HTTP/FTP use the wget fetcher | 602 | # HTTP/FTP use the wget fetcher |
603 | if scheme in ("http", "https", "ftp"): | 603 | if uri.scheme in ("http", "https", "ftp"): |
604 | d.appendVarFlag('do_fetch', 'depends', ' wget-native:do_populate_sysroot') | 604 | d.appendVarFlag('do_fetch', 'depends', ' wget-native:do_populate_sysroot') |
605 | 605 | ||
606 | # Svn packages should DEPEND on subversion-native | 606 | # Svn packages should DEPEND on subversion-native |
607 | if scheme == "svn": | 607 | if uri.scheme == "svn": |
608 | needsrcrev = True | 608 | needsrcrev = True |
609 | d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot') | 609 | d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot') |
610 | 610 | ||
611 | # Git packages should DEPEND on git-native | 611 | # Git packages should DEPEND on git-native |
612 | elif scheme in ("git", "gitsm"): | 612 | elif uri.scheme in ("git", "gitsm"): |
613 | needsrcrev = True | 613 | needsrcrev = True |
614 | d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot') | 614 | d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot') |
615 | 615 | ||
616 | # Mercurial packages should DEPEND on mercurial-native | 616 | # Mercurial packages should DEPEND on mercurial-native |
617 | elif scheme == "hg": | 617 | elif uri.scheme == "hg": |
618 | needsrcrev = True | 618 | needsrcrev = True |
619 | d.appendVar("EXTRANATIVEPATH", ' python3-native ') | 619 | d.appendVar("EXTRANATIVEPATH", ' python3-native ') |
620 | d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot') | 620 | d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot') |
621 | 621 | ||
622 | # Perforce packages support SRCREV = "${AUTOREV}" | 622 | # Perforce packages support SRCREV = "${AUTOREV}" |
623 | elif scheme == "p4": | 623 | elif uri.scheme == "p4": |
624 | needsrcrev = True | 624 | needsrcrev = True |
625 | 625 | ||
626 | # OSC packages should DEPEND on osc-native | 626 | # OSC packages should DEPEND on osc-native |
627 | elif scheme == "osc": | 627 | elif uri.scheme == "osc": |
628 | d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot') | 628 | d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot') |
629 | 629 | ||
630 | elif scheme == "npm": | 630 | elif uri.scheme == "npm": |
631 | d.appendVarFlag('do_fetch', 'depends', ' nodejs-native:do_populate_sysroot') | 631 | d.appendVarFlag('do_fetch', 'depends', ' nodejs-native:do_populate_sysroot') |
632 | 632 | ||
633 | # *.lz4 should DEPEND on lz4-native for unpacking | 633 | # *.lz4 should DEPEND on lz4-native for unpacking |
634 | if path.endswith('.lz4'): | 634 | if uri.path.endswith('.lz4'): |
635 | d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot') | 635 | d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot') |
636 | 636 | ||
637 | # *.lz should DEPEND on lzip-native for unpacking | 637 | # *.lz should DEPEND on lzip-native for unpacking |
638 | elif path.endswith('.lz'): | 638 | elif uri.path.endswith('.lz'): |
639 | d.appendVarFlag('do_unpack', 'depends', ' lzip-native:do_populate_sysroot') | 639 | d.appendVarFlag('do_unpack', 'depends', ' lzip-native:do_populate_sysroot') |
640 | 640 | ||
641 | # *.xz should DEPEND on xz-native for unpacking | 641 | # *.xz should DEPEND on xz-native for unpacking |
642 | elif path.endswith('.xz') or path.endswith('.txz'): | 642 | elif uri.path.endswith('.xz') or uri.path.endswith('.txz'): |
643 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') | 643 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') |
644 | 644 | ||
645 | # .zip should DEPEND on unzip-native for unpacking | 645 | # .zip should DEPEND on unzip-native for unpacking |
646 | elif path.endswith('.zip') or path.endswith('.jar'): | 646 | elif uri.path.endswith('.zip') or uri.path.endswith('.jar'): |
647 | d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot') | 647 | d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot') |
648 | 648 | ||
649 | # Some rpm files may be compressed internally using xz (for example, rpms from Fedora) | 649 | # Some rpm files may be compressed internally using xz (for example, rpms from Fedora) |
650 | elif path.endswith('.rpm'): | 650 | elif uri.path.endswith('.rpm'): |
651 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') | 651 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') |
652 | 652 | ||
653 | # *.deb should DEPEND on xz-native for unpacking | 653 | # *.deb should DEPEND on xz-native for unpacking |
654 | elif path.endswith('.deb'): | 654 | elif uri.path.endswith('.deb'): |
655 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') | 655 | d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot') |
656 | 656 | ||
657 | if needsrcrev: | 657 | if needsrcrev: |