]> code.ossystems Code Review - openembedded-core.git/commit
devtool: upgrade: fix handling of errors parsing upgraded recipe
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 2 Jul 2019 04:24:00 +0000 (16:24 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Jul 2019 08:09:50 +0000 (09:09 +0100)
commitc519ac360796675d7fc09a5250d21f0f5b6236fc
tree44995d54d4208518b09cdd17c132197d0d320f26
parent548a5c8f42c6ac1b0f7962926d05276e71505678
devtool: upgrade: fix handling of errors parsing upgraded recipe

As part of upgrading a recipe we create the upgraded recipe file in the
workspace and then try to parse it so we can then make further
modifications. If for some reason that parsing fails then the failure
was not being handled very well - the broken recipe was being left in
place, breaking parsing until it was removed by hand. Fix that by adding
a call to the cleanup function, and fix the following issues:

* Fix the cleanup function which doesn't look like it has ever worked
  due to a typo in the function call

* Fix double-printing the error message

* Remove usage of DevtoolError in this case (DevtoolError is for simple
  usage errors, not this kind of issue which may be the result of a
  bug).

We're still printing a traceback in this scenario but at least it
doesn't break the build system requiring manual cleanup. I also
introduced a command-line option to preserve the broken upgraded recipe
file(s) for debugging purposes.

(The reproducer for this is "devtool upgrade libnewt-python", however
you need to check out revision b82ea144e144671d3f64c0785ba4beafe905cd4f
or earlier since that recipe has now been absorbed into the libnewt
recipe. The libnewt-python recipe was causing an issue with the upgrade
because it actually included the libnewt recipe using ${PV} in the
include statement, and of course PV was changing in the upgrade.)

Fixes [YOCTO #13404].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/upgrade.py