summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py8
-rw-r--r--bitbake/lib/bb/fetch2/git.py2
-rw-r--r--bitbake/lib/bb/parse/ast.py3
3 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 3b96849a25..718b9f2958 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -749,10 +749,13 @@ def subprocess_setup():
749 # SIGPIPE errors are known issues with gzip/bash 749 # SIGPIPE errors are known issues with gzip/bash
750 signal.signal(signal.SIGPIPE, signal.SIG_DFL) 750 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
751 751
752def get_autorev(d): 752def mark_recipe_nocache(d):
753 # only not cache src rev in autorev case
754 if d.getVar('BB_SRCREV_POLICY') != "cache": 753 if d.getVar('BB_SRCREV_POLICY') != "cache":
755 d.setVar('BB_DONT_CACHE', '1') 754 d.setVar('BB_DONT_CACHE', '1')
755
756def get_autorev(d):
757 mark_recipe_nocache(d)
758 d.setVar("__BBAUTOREV_SEEN", True)
756 return "AUTOINC" 759 return "AUTOINC"
757 760
758def get_srcrev(d, method_name='sortable_revision'): 761def get_srcrev(d, method_name='sortable_revision'):
@@ -1219,6 +1222,7 @@ def srcrev_internal_helper(ud, d, name):
1219 if srcrev == "INVALID" or not srcrev: 1222 if srcrev == "INVALID" or not srcrev:
1220 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) 1223 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)
1221 if srcrev == "AUTOINC": 1224 if srcrev == "AUTOINC":
1225 d.setVar("__BBAUTOREV_ACTED_UPON", True)
1222 srcrev = ud.method.latest_revision(ud, d, name) 1226 srcrev = ud.method.latest_revision(ud, d, name)
1223 1227
1224 return srcrev 1228 return srcrev
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 66c2a7e540..d0d68538e2 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -737,7 +737,7 @@ class Git(FetchMethod):
737 raise bb.fetch2.FetchError("Recipe uses a floating tag/branch '%s' for repo '%s' without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE)." % (ud.unresolvedrev[name], ud.host+ud.path)) 737 raise bb.fetch2.FetchError("Recipe uses a floating tag/branch '%s' for repo '%s' without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE)." % (ud.unresolvedrev[name], ud.host+ud.path))
738 738
739 # Ensure we mark as not cached 739 # Ensure we mark as not cached
740 bb.fetch2.get_autorev(d) 740 bb.fetch2.mark_recipe_nocache(d)
741 741
742 output = self._lsremote(ud, d, "") 742 output = self._lsremote(ud, d, "")
743 # Tags of the form ^{} may not work, need to fallback to other form 743 # Tags of the form ^{} may not work, need to fallback to other form
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 375ba3cb79..6441c5cf7c 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -400,6 +400,9 @@ def finalize(fn, d, variant = None):
400 400
401 d.setVar('BBINCLUDED', bb.parse.get_file_depends(d)) 401 d.setVar('BBINCLUDED', bb.parse.get_file_depends(d))
402 402
403 if d.getVar('__BBAUTOREV_SEEN') and d.getVar('__BBSRCREV_SEEN') and not d.getVar("__BBAUTOREV_ACTED_UPON"):
404 bb.fatal("AUTOREV/SRCPV set too late for the fetcher to work properly, please set the variables earlier in parsing. Erroring instead of later obtuse build failures.")
405
403 bb.event.fire(bb.event.RecipeParsed(fn), d) 406 bb.event.fire(bb.event.RecipeParsed(fn), d)
404 finally: 407 finally:
405 bb.event.set_handlers(saved_handlers) 408 bb.event.set_handlers(saved_handlers)