diff options
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index cc8891f48b..f3252640cb 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1147,6 +1147,8 @@ class BBCooker: | |||
1147 | collection_list = collections.split() | 1147 | collection_list = collections.split() |
1148 | min_prio = 0 | 1148 | min_prio = 0 |
1149 | for c in collection_list: | 1149 | for c in collection_list: |
1150 | bb.debug(1,'Processing %s in collection list' % (c)) | ||
1151 | |||
1150 | # Get collection priority if defined explicitly | 1152 | # Get collection priority if defined explicitly |
1151 | priority = self.data.getVar("BBFILE_PRIORITY_%s" % c, True) | 1153 | priority = self.data.getVar("BBFILE_PRIORITY_%s" % c, True) |
1152 | if priority: | 1154 | if priority: |
@@ -1165,10 +1167,10 @@ class BBCooker: | |||
1165 | deps = self.data.getVar("LAYERDEPENDS_%s" % c, True) | 1167 | deps = self.data.getVar("LAYERDEPENDS_%s" % c, True) |
1166 | if deps: | 1168 | if deps: |
1167 | try: | 1169 | try: |
1168 | deplist = bb.utils.explode_dep_versions2(deps) | 1170 | depDict = bb.utils.explode_dep_versions2(deps) |
1169 | except bb.utils.VersionStringException as vse: | 1171 | except bb.utils.VersionStringException as vse: |
1170 | bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (c, str(vse))) | 1172 | bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (c, str(vse))) |
1171 | for dep, oplist in list(deplist.items()): | 1173 | for dep, oplist in list(depDict.items()): |
1172 | if dep in collection_list: | 1174 | if dep in collection_list: |
1173 | for opstr in oplist: | 1175 | for opstr in oplist: |
1174 | layerver = self.data.getVar("LAYERVERSION_%s" % dep, True) | 1176 | layerver = self.data.getVar("LAYERVERSION_%s" % dep, True) |
@@ -1187,10 +1189,39 @@ class BBCooker: | |||
1187 | else: | 1189 | else: |
1188 | parselog.error("Layer '%s' depends on layer '%s', but this layer is not enabled in your configuration", c, dep) | 1190 | parselog.error("Layer '%s' depends on layer '%s', but this layer is not enabled in your configuration", c, dep) |
1189 | errors = True | 1191 | errors = True |
1190 | collection_depends[c] = deplist.keys() | 1192 | collection_depends[c] = list(depDict.keys()) |
1191 | else: | 1193 | else: |
1192 | collection_depends[c] = [] | 1194 | collection_depends[c] = [] |
1193 | 1195 | ||
1196 | # Check recommends and store information for priority calculation | ||
1197 | recs = self.data.getVar("LAYERRECOMMENDS_%s" % c, True) | ||
1198 | if recs: | ||
1199 | try: | ||
1200 | recDict = bb.utils.explode_dep_versions2(recs) | ||
1201 | except bb.utils.VersionStringException as vse: | ||
1202 | bb.fatal('Error parsing LAYERRECOMMENDS_%s: %s' % (c, str(vse))) | ||
1203 | for rec, oplist in list(recDict.items()): | ||
1204 | if rec in collection_list: | ||
1205 | if oplist: | ||
1206 | opstr = oplist[0] | ||
1207 | layerver = self.data.getVar("LAYERVERSION_%s" % rec, True) | ||
1208 | if layerver: | ||
1209 | (op, recver) = opstr.split() | ||
1210 | try: | ||
1211 | res = bb.utils.vercmp_string_op(layerver, recver, op) | ||
1212 | except bb.utils.VersionStringException as vse: | ||
1213 | bb.fatal('Error parsing LAYERRECOMMENDS_%s: %s' % (c, str(vse))) | ||
1214 | if not res: | ||
1215 | parselog.debug(3,"Layer '%s' recommends version %s of layer '%s', but version %s is currently enabled in your configuration. Check that you are using the correct matching versions/branches of these two layers.", c, opstr, rec, layerver) | ||
1216 | continue | ||
1217 | else: | ||
1218 | parselog.debug(3,"Layer '%s' recommends version %s of layer '%s', which exists in your configuration but does not specify a version. Check that you are using the correct matching versions/branches of these two layers.", c, opstr, rec) | ||
1219 | continue | ||
1220 | parselog.debug(3,"Layer '%s' recommends layer '%s', so we are adding it", c, rec) | ||
1221 | collection_depends[c].append(rec) | ||
1222 | else: | ||
1223 | parselog.debug(3,"Layer '%s' recommends layer '%s', but this layer is not enabled in your configuration", c, rec) | ||
1224 | |||
1194 | # Recursively work out collection priorities based on dependencies | 1225 | # Recursively work out collection priorities based on dependencies |
1195 | def calc_layer_priority(collection): | 1226 | def calc_layer_priority(collection): |
1196 | if not collection_priorities[collection]: | 1227 | if not collection_priorities[collection]: |