]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
devtool: upgrade: fix handling of errors parsing upgraded recipe paule/devtool36-oe
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 1 Jul 2019 03:55:56 +0000 (15:55 +1200)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 2 Jul 2019 04:23:17 +0000 (16:23 +1200)
commitfc845c219ccb0dc686d0fbfdcb4df7ed31adc2ea
treec86f5db3e1bffdb2510f703ca94697230e4edb9a
parentd08a9825c7632ce886ec1749bdbb73beb54eab3f
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>
scripts/lib/devtool/upgrade.py