[SCM] build.samba.org - branch master updated
Jelmer Vernooij
jelmer at samba.org
Fri Dec 3 19:46:35 MST 2010
The branch, master has been updated
via 11684a6 allow bz2 compressed files.
from f4460a7 Allow viewing trees.
http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 11684a6ca758fd5756c554606b0d23e6eb516b30
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Sat Dec 4 03:47:06 2010 +0100
allow bz2 compressed files.
-----------------------------------------------------------------------
Summary of changes:
buildfarm/build.py | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildfarm/build.py b/buildfarm/build.py
index 329b214..1c73cb2 100644
--- a/buildfarm/build.py
+++ b/buildfarm/build.py
@@ -21,6 +21,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+import bz2
from cStringIO import StringIO
import collections
import hashlib
@@ -32,6 +33,13 @@ from storm.expr import Desc
import time
+def open_opt_compressed_file(path):
+ try:
+ return bz2.BZ2File(path+".bz2", 'r')
+ except IOError:
+ return open(path, 'r')
+
+
class Test(object):
def __init__(self, name):
@@ -322,21 +330,21 @@ class Build(object):
def read_subunit(self):
"""read the test output as subunit"""
try:
- return open(self.basename+".subunit", "r")
+ return open_opt_compressed_file(self.basename+".subunit")
except IOError:
raise NoTestOutput()
def read_log(self):
"""read full log file"""
try:
- return open(self.basename+".log", "r")
+ return open_opt_compressed_file(self.basename+".log")
except IOError:
raise LogFileMissing()
def read_err(self):
"""read full err file"""
try:
- return open(self.basename+".err", 'r')
+ return open_opt_compressed_file(self.basename+".err")
except IOError:
# No such file
return StringIO()
@@ -534,10 +542,10 @@ class BuildResultStore(object):
rev = build.revision_details()
new_basename = self.build_fname(build.tree, build.host, build.compiler, rev)
- if os.path.exists(new_basename+".log"):
- os.remove(new_basename+".log")
- if os.path.exists(new_basename+".err"):
- os.remove(new_basename+".err")
+ for name in os.listdir(self.path):
+ p = os.path.join(self.path, name)
+ if p.startswith(new_basename+"."):
+ os.remove(p)
os.link(build.basename+".log", new_basename+".log")
if os.path.exists(build.basename+".err"):
os.link(build.basename+".err", new_basename+".err")
@@ -546,7 +554,7 @@ class BuildResultStore(object):
except NoTestOutput:
pass
else:
- f = open(new_basename+".subunit", 'w')
+ f = bz2.BZ2File(new_basename+".subunit.bz2", 'w')
try:
f.writelines(subunit_output)
finally:
--
build.samba.org
More information about the samba-cvs
mailing list