]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch2: Improve invalid SRCREV error message
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Jan 2014 13:25:43 +0000 (13:25 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Jan 2014 15:15:26 +0000 (15:15 +0000)
The current message can be ambiguous, improve it (and also rename a
variable to clean up the rest of the function).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/__init__.py

index 8b6c3eed6c592339770f5f25bc6b112c0063145c..de95074c402d95a5c17d30d328427b6f27a91a4b 100644 (file)
@@ -897,17 +897,12 @@ def srcrev_internal_helper(ud, d, name):
             raise FetchError("Conflicting revisions (%s from SRCREV and %s from the url) found, please spcify one valid value" % (srcrev, parmrev))
         return parmrev
 
-    rev = srcrev
-    if rev == "INVALID" or not rev:
-        var = "SRCREV_pn-%s" % pn
-        if name != '':
-            var = "SRCREV_%s_pn-%s" % (name, pn)
-        raise FetchError("Please set %s to a valid value" % var, ud.url)
-    if rev == "AUTOINC":
-        rev = ud.method.latest_revision(ud, d, name)
-
-    return rev
+    if srcrev == "INVALID" or not srcrev:
+        raise FetchError("Please set a valid SRCREV for url %s (possible key names are %s, or use a ;rev=X URL parameter)" % (str(attempts), ud.url), ud.url)
+    if srcrev == "AUTOINC":
+        srcrev = ud.method.latest_revision(ud, d, name)
 
+    return srcrev
 
 def get_checksum_file_list(d):
     """ Get a list of files checksum in SRC_URI