[Buildbot-commits] buildbot/buildbot/steps shell.py,1.8,1.9
Brian Warner
warner at users.sourceforge.net
Sun Dec 23 08:35:33 UTC 2007
Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2652/buildbot/steps
Modified Files:
shell.py
Log Message:
[project @ make TreeSize actually work. Closes #47.]
Original author: warner at lothar.com
Date: 2007-12-23 08:34:26+00:00
Index: shell.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/shell.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- shell.py 23 Dec 2007 07:17:01 -0000 1.8
+++ shell.py 23 Dec 2007 08:35:31 -0000 1.9
@@ -233,25 +233,26 @@
class TreeSize(ShellCommand):
name = "treesize"
- command = ["du", "-s", "."]
- kb = None
+ command = ["du", "-s", "-k", "."]
+ kib = None
def commandComplete(self, cmd):
- out = cmd.log.getText()
+ out = cmd.logs['stdio'].getText()
m = re.search(r'^(\d+)', out)
if m:
- self.kb = int(m.group(1))
+ self.kib = int(m.group(1))
+ self.setProperty("tree-size-KiB", self.kib)
def evaluateCommand(self, cmd):
if cmd.rc != 0:
return FAILURE
- if self.kb is None:
+ if self.kib is None:
return WARNINGS # not sure how 'du' could fail, but whatever
return SUCCESS
def getText(self, cmd, results):
- if self.kb is not None:
- return ["treesize", "%d kb" % self.kb]
+ if self.kib is not None:
+ return ["treesize", "%d KiB" % self.kib]
return ["treesize", "unknown"]
class Configure(ShellCommand):
More information about the Commits
mailing list