@@ -36,7 +36,7 @@ def load_env(devtool, bb, git, opts, group):
os.mkdir(group['workdir'])
for pkg_ctx in group['pkgs']:
pkg_ctx['env'] = bb.env(pkg_ctx['PN'])
- pkg_ctx['recipe_dir'] = os.path.dirname(pkg_ctx['env']['FILE'])
+ pkg_ctx['recipe_dir'] = os.path.realpath(os.path.dirname(pkg_ctx['env']['FILE']))
def buildhistory_init(devtool, bb, git, opts, group):
if not opts['buildhistory']:
@@ -123,8 +123,12 @@ class Bitbake(object):
env = "TCLIBC={}".format(libc)
else:
env = ""
- bb.process.run("bitbake-config-build enable-fragment machine/{}".format(machine))
- return self._cmd(recipe, env_var=env)
+ try:
+ bb.process.run("bitbake-config-build enable-fragment machine/{}".format(machine))
+ except bb.process.ExecutionError:
+ # bitbake-config-build not available (e.g. scarthgap), use MACHINE env var
+ env = "MACHINE={} {}".format(machine, env).strip()
+ return self._cmd(recipe, env_var=env if env else None)
def dependency_graph(self, package_list):
return self._cmd(package_list, "-g")
@@ -713,7 +713,26 @@ class UniverseUpdater(Updater):
for layer_name, layer_recipes in self.recipes:
pkggroups = oe.recipeutils.get_recipe_upgrade_status(layer_recipes)
- for group in pkggroups:
+ # Consume the generator one item at a time so that a fetch
+ # failure for one recipe (e.g. unreachable upstream) does not
+ # abort the entire upgrade run.
+ while True:
+ try:
+ group = next(pkggroups)
+ except StopIteration:
+ break
+ except Exception as e:
+ W(" Skipping recipe due to fetch error: %s" % str(e))
+ continue
+
+ # Scarthgap returns flat tuples; normalize to list-of-dicts
+ # so the existing loop handles both formats.
+ if not isinstance(group, (list, tuple)) or not group or not isinstance(group[0], dict):
+ pn, status, cur_ver, next_ver, maintainer, revision, no_upgrade_reason = group
+ group = [{'pn': pn, 'status': status, 'cur_ver': cur_ver,
+ 'next_ver': next_ver, 'maintainer': maintainer,
+ 'revision': revision, 'no_upgrade_reason': no_upgrade_reason}]
+
upgrade_group = []
for pkg in group:
maintainer = pkg['maintainer']