Bladeren bron

fetch/__init__.py: Raise an exception if SRCREV == 'INVALID' (from Poky)

Richard Purdie 15 jaren geleden
bovenliggende
commit
b3acedac34
2 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  1. 1 0
      ChangeLog
  2. 5 0
      lib/bb/fetch/__init__.py

+ 1 - 0
ChangeLog

@@ -144,6 +144,7 @@ Changes in Bitbake 1.9.x:
 	- When a regexp fails to compile for PACKAGES_DYNAMIC, print a more useful error (#4444)
 	- Allow to checkout CVS by Date and Time. Just add HHmm to the SRCDATE.
 	- Move prunedir function to utils.py and add explode_dep_versions function
+	- Raise an exception if SRCREV == 'INVALID'
 
 Changes in Bitbake 1.8.0:
 	- Release 1.7.x as a stable series

+ 5 - 0
lib/bb/fetch/__init__.py

@@ -49,6 +49,9 @@ class ParameterError(Exception):
 class MD5SumError(Exception):
     """Exception raised when a MD5SUM of a file does not match the expected one"""
 
+class InvalidSRCREV(Exception):
+    """Exception raised when an invalid SRCREV is encountered"""
+
 def uri_replace(uri, uri_find, uri_replace, d):
 #   bb.msg.note(1, bb.msg.domain.Fetcher, "uri_replace: operating on %s" % uri)
     if not uri or not uri_find or not uri_replace:
@@ -425,6 +428,8 @@ class Fetch(object):
             rev = data.getVar("SRCREV_pn-" + pn + "_" + ud.parm['name'], d, 1)
         if not rev:
             rev = data.getVar("SRCREV", d, 1)
+        if rev == "INVALID":
+            raise InvalidSRCREV("Please set SRCREV to a valid value")
         if not rev:
             return False
         if rev is "SRCREVINACTION":