From: Alexander Kanavin <alex.kana...@gmail.com> This helps avoid 'cascading build failures' where one failed update holds up everything else.
Signed-off-by: Alexander Kanavin <alex.kana...@gmail.com> --- modules/utils/git.py | 3 +++ upgradehelper.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/utils/git.py b/modules/utils/git.py index 0e812b9..749d24d 100644 --- a/modules/utils/git.py +++ b/modules/utils/git.py @@ -61,6 +61,9 @@ class Git(object): else: return self._cmd("commit -a --author=\"" + author + "\" -m \"" + commit_message + "\"") + def revert(self, commit): + return self._cmd("revert --no-edit " + commit) + def create_patch(self, out_dir): return self._cmd("format-patch -M10 -1 -o " + out_dir) diff --git a/upgradehelper.py b/upgradehelper.py index 58fa0a6..71ee0b0 100755 --- a/upgradehelper.py +++ b/upgradehelper.py @@ -414,6 +414,9 @@ class Updater(object): else: I(" %s: Save patch in directory: %s." % (pkg_ctx['PN'], pkg_ctx['workdir'])) + if pkg_ctx['error'] is not None: + I("Due to build errors, the commit will also be reverted to avoid cascading upgrade failures.") + self.git.revert("HEAD") except Error as e: msg = '' -- 2.15.0 -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto