]> code.ossystems Code Review - openembedded-core.git/commitdiff
cooker: use time.strftime() instead of spawing sh with date
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 7 Jun 2010 18:50:05 +0000 (20:50 +0200)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 2 Jul 2010 14:41:35 +0000 (15:41 +0100)
time.strftime() defaults to using time.localtime(), use that instead
of spawning "sh -c 'date +<FMT>'"

(Bitbake rev: ec1f2773b4811b3beb52710120bb5a9b215c174e)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/cooker.py

index 9d21b331433923ea87962ed98da7f6f84ae2254d..2b38065de242ba70352ac7666a39e61f3ad1bec7 100644 (file)
@@ -609,7 +609,7 @@ class BBCooker:
         Setup any variables needed before starting a build
         """
         if not bb.data.getVar("BUILDNAME", self.configuration.data):
-            bb.data.setVar("BUILDNAME", os.popen('date +%Y%m%d%H%M').readline().strip(), self.configuration.data)
+            bb.data.setVar("BUILDNAME", time.strftime('%Y%m%d%H%M'), self.configuration.data)
         bb.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', time.gmtime()), self.configuration.data)
 
     def matchFiles(self, buildfile):