[yocto] [yocto-autobuilder][PATCH] GetLayerVersion.py: set new layer version only if cmd was sucessful and not already set
Randy Witt
randy.e.witt at linux.intel.com
Wed May 25 14:03:43 PDT 2016
On 05/25/2016 01:28 PM, Bill Randle wrote:
> Fixed a bug where GetLayerVersion set the layerversion to -1 when a
> meta-poky layer.conf was not found.
>
> Signed-off-by: Bill Randle <william.c.randle at intel.com>
> ---
> .../autobuilder/buildsteps/GetLayerVersion.py | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/GetLayerVersion.py b/lib/python2.7/site-packages/autobuilder/buildsteps/GetLayerVersion.py
> index de5c203..3f167e8 100644
> --- a/lib/python2.7/site-packages/autobuilder/buildsteps/GetLayerVersion.py
> +++ b/lib/python2.7/site-packages/autobuilder/buildsteps/GetLayerVersion.py
> @@ -44,15 +44,12 @@ class GetLayerVersion(ShellCommand):
> ShellCommand.start(self)
>
> def commandComplete(self, cmd):
> - result = cmd.logs['stdio'].getText()
> - layerv= result.replace("LAYERVERSION_" + self.layerfile, "").replace("=","").replace(' ','').replace('"','').replace("'",'').strip()
> - if cmd.didFail():
> - layerv = "-1"
> - if self.getProperty('layerversion_' + self.layerfile):
> - self.finished(SUCCESS)
> - else:
> - self.setProperty('layerversion_' + self.layerfile, layerv, "Setting Layer Version")
> - self.finished(SUCCESS)
> + if not cmd.didFail():
> + result = cmd.logs['stdio'].getText()
> + layerv = result.replace("LAYERVERSION_" + self.layerfile, "").replace("=","").replace(' ','').replace('"','').replace("'",'').strip()
> + if not self.getProperty('layerversion_' + self.layerfile):
> + self.setProperty('layerversion_' + self.layerfile, layerv, "Setting Layer Version")
> + self.finished(SUCCESS)
What happens if the command actually failed?
>
> def getText(self, cmd, results):
> return ShellCommand.getText(self, cmd, results)
>
More information about the yocto
mailing list