diff options
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 31729885ab..1a86d8fd81 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -560,7 +560,6 @@ def verify_checksum(ud, d, precomputed={}, localpath=None, fatal_nochecksum=True | |||
560 | file against those in the recipe each time, rather than only after | 560 | file against those in the recipe each time, rather than only after |
561 | downloading. See https://bugzilla.yoctoproject.org/show_bug.cgi?id=5571. | 561 | downloading. See https://bugzilla.yoctoproject.org/show_bug.cgi?id=5571. |
562 | """ | 562 | """ |
563 | |||
564 | if ud.ignore_checksums or not ud.method.supports_checksum(ud): | 563 | if ud.ignore_checksums or not ud.method.supports_checksum(ud): |
565 | return {} | 564 | return {} |
566 | 565 | ||
@@ -605,11 +604,7 @@ def verify_checksum(ud, d, precomputed={}, localpath=None, fatal_nochecksum=True | |||
605 | 604 | ||
606 | # If strict checking enabled and neither sum defined, raise error | 605 | # If strict checking enabled and neither sum defined, raise error |
607 | if strict == "1": | 606 | if strict == "1": |
608 | messages.append("No checksum specified for '%s', please add at " \ | 607 | raise NoChecksumError("\n".join(checksum_lines)) |
609 | "least one to the recipe:" % ud.localpath) | ||
610 | messages.extend(checksum_lines) | ||
611 | logger.error("\n".join(messages)) | ||
612 | raise NoChecksumError("Missing SRC_URI checksum", ud.url) | ||
613 | 608 | ||
614 | bb.event.fire(MissingChecksumEvent(ud.url, **checksum_event), d) | 609 | bb.event.fire(MissingChecksumEvent(ud.url, **checksum_event), d) |
615 | 610 | ||
@@ -1728,6 +1723,7 @@ class Fetch(object): | |||
1728 | network = self.d.getVar("BB_NO_NETWORK") | 1723 | network = self.d.getVar("BB_NO_NETWORK") |
1729 | premirroronly = bb.utils.to_boolean(self.d.getVar("BB_FETCH_PREMIRRORONLY")) | 1724 | premirroronly = bb.utils.to_boolean(self.d.getVar("BB_FETCH_PREMIRRORONLY")) |
1730 | 1725 | ||
1726 | checksum_missing_messages = [] | ||
1731 | for u in urls: | 1727 | for u in urls: |
1732 | ud = self.ud[u] | 1728 | ud = self.ud[u] |
1733 | ud.setup_localpath(self.d) | 1729 | ud.setup_localpath(self.d) |
@@ -1739,7 +1735,6 @@ class Fetch(object): | |||
1739 | 1735 | ||
1740 | try: | 1736 | try: |
1741 | self.d.setVar("BB_NO_NETWORK", network) | 1737 | self.d.setVar("BB_NO_NETWORK", network) |
1742 | |||
1743 | if m.verify_donestamp(ud, self.d) and not m.need_update(ud, self.d): | 1738 | if m.verify_donestamp(ud, self.d) and not m.need_update(ud, self.d): |
1744 | done = True | 1739 | done = True |
1745 | elif m.try_premirror(ud, self.d): | 1740 | elif m.try_premirror(ud, self.d): |
@@ -1811,13 +1806,20 @@ class Fetch(object): | |||
1811 | raise ChecksumError("Stale Error Detected") | 1806 | raise ChecksumError("Stale Error Detected") |
1812 | 1807 | ||
1813 | except BBFetchException as e: | 1808 | except BBFetchException as e: |
1814 | if isinstance(e, ChecksumError): | 1809 | if isinstance(e, NoChecksumError): |
1810 | (message, _) = e.args | ||
1811 | checksum_missing_messages.append(message) | ||
1812 | continue | ||
1813 | elif isinstance(e, ChecksumError): | ||
1815 | logger.error("Checksum failure fetching %s" % u) | 1814 | logger.error("Checksum failure fetching %s" % u) |
1816 | raise | 1815 | raise |
1817 | 1816 | ||
1818 | finally: | 1817 | finally: |
1819 | if ud.lockfile: | 1818 | if ud.lockfile: |
1820 | bb.utils.unlockfile(lf) | 1819 | bb.utils.unlockfile(lf) |
1820 | if checksum_missing_messages: | ||
1821 | logger.error("Missing SRC_URI checksum, please add those to the recipe: \n%s", "\n".join(checksum_missing_messages)) | ||
1822 | raise BBFetchException("There was some missing checksums in the recipe") | ||
1821 | 1823 | ||
1822 | def checkstatus(self, urls=None): | 1824 | def checkstatus(self, urls=None): |
1823 | """ | 1825 | """ |