All of lore.kernel.org
 help / color / mirror / Atom feed
* [yocto-autobuilder][PATCH] GetLayerVersion.py: set new layer version only if cmd was sucessful and not already set
@ 2016-05-25 20:28 Bill Randle
  2016-05-25 21:03 ` Randy Witt
  2016-05-26 14:15 ` Flanagan, Elizabeth
  0 siblings, 2 replies; 4+ messages in thread
From: Bill Randle @ 2016-05-25 20:28 UTC (permalink / raw)
  To: yocto

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@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)
 
     def getText(self, cmd, results):
         return ShellCommand.getText(self, cmd, results)
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-26 14:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-25 20:28 [yocto-autobuilder][PATCH] GetLayerVersion.py: set new layer version only if cmd was sucessful and not already set Bill Randle
2016-05-25 21:03 ` Randy Witt
2016-05-25 21:12   ` Randle, William C
2016-05-26 14:15 ` Flanagan, Elizabeth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.