summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index f2a9f15fd9..f4cff03225 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -873,17 +873,24 @@ def srcrev_internal_helper(ud, d, name):
873 if 'tag' in ud.parm: 873 if 'tag' in ud.parm:
874 return ud.parm['tag'] 874 return ud.parm['tag']
875 875
876 rev = None 876 srcrev = None
877 pn = d.getVar("PN", True) 877 pn = d.getVar("PN", True)
878 attempts = []
879 if name != '' and pn:
880 attempts.append("SRCREV_%s_pn-%s" % (name, pn))
878 if name != '': 881 if name != '':
879 rev = d.getVar("SRCREV_%s_pn-%s" % (name, pn), True) 882 attempts.append("SRCREV_%s" % name)
880 if not rev: 883 if pn:
881 rev = d.getVar("SRCREV_%s" % name, True) 884 attempts.append("SRCREV_pn-%s" % pn)
882 if not rev: 885 attempts.append("SRCREV")
883 rev = d.getVar("SRCREV_pn-%s" % pn, True) 886
884 if not rev: 887 for a in attempts:
885 rev = d.getVar("SRCREV", True) 888 srcrev = d.getVar(a, True)
886 if rev == "INVALID": 889 if srcrev and srcrev != "INVALID":
890 break
891
892 rev = srcrev
893 if rev == "INVALID" or not rev:
887 var = "SRCREV_pn-%s" % pn 894 var = "SRCREV_pn-%s" % pn
888 if name != '': 895 if name != '':
889 var = "SRCREV_%s_pn-%s" % (name, pn) 896 var = "SRCREV_%s_pn-%s" % (name, pn)