On Wed, 2016-05-25 at 14:03 -0700, Randy Witt wrote:
> 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.ran...@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?

It just sets SUCCESS and carries on. What's going on is that the code that calls
this is iterating over different layers, starting with meta-poky, then meta-
yocto. When building a version prior to the meta-yocto -> meta-poky transition,
it will fail to find meta-poky/conf/layer.conf, but it's ok, because it will
next try meta-yocto/conf/layer.conf and succeed.

What was going on before is that on failure, if the layerversion was not
previouisly set, it would get set to -1 on that failure and not get overriden by
the correct version in meta-yocto/conf.

    -Bill
-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to