pld-builder.new: PLD_Builder/request.py, PLD_Builder/rpm_builder.py, PLD_Bu...
arekm
arekm at pld-linux.org
Fri Feb 27 23:04:48 CET 2009
Author: arekm Date: Fri Feb 27 22:04:48 2009 GMT
Module: pld-builder.new Tag: HEAD
---- Log message:
- more interesting failure statuses.
---- Files affected:
pld-builder.new/PLD_Builder:
request.py (1.56 -> 1.57) , rpm_builder.py (1.68 -> 1.69) , srpm_builder.py (1.52 -> 1.53) , util.py (1.10 -> 1.11)
---- Diffs:
================================================================
Index: pld-builder.new/PLD_Builder/request.py
diff -u pld-builder.new/PLD_Builder/request.py:1.56 pld-builder.new/PLD_Builder/request.py:1.57
--- pld-builder.new/PLD_Builder/request.py:1.56 Fri Feb 27 22:02:08 2009
+++ pld-builder.new/PLD_Builder/request.py Fri Feb 27 23:04:43 2009
@@ -168,8 +168,7 @@
ok = 1
for b in self.builders:
s = self.builders_status[b]
- if not s in ["OK", "FAIL", "FAIL_SRPM_INSTALL", "FAIL_DEPS_UNINSTALL", "FAIL_DEPS_INSTALL",
- "FAIL_NOFILES", "SKIP", "UNSUPP"]:
+ if not s in ["OK", "SKIP", "UNSUPP" ] and not s.startswith("FAIL"):
ok = 0
return ok
@@ -201,7 +200,7 @@
s = self.builders_status[b]
if s == "OK":
c = "green"
- elif s in ["FAIL", "FAIL_SRPM_INSTALL", "FAIL_DEPS_UNINSTALL", "FAIL_DEPS_INSTALL", "FAIL_NOFILES"]:
+ elif s.startswith("FAIL"):
c = "red"
elif s == "SKIP":
c = "blue"
@@ -211,8 +210,7 @@
c = "black"
link_pre = ""
link_post = ""
- if s in ["OK", "FAIL", "FAIL_SRPM_INSTALL", "FAIL_DEPS_UNINSTALL", "FAIL_DEPS_INSTALL", "FAIL_NOFILES",
- "SKIP", "UNSUPP"] and len(self.spec) > 5:
+ if (s in ["OK", "SKIP", "UNSUPP" ] or s.startswith("FAIL")) and len(self.spec) > 5:
if self.is_command():
bl_name = "command"
else:
@@ -310,7 +308,7 @@
if c.nodeName == "batch":
id = attr(c, "id")
status = attr(c, "status")
- if status not in ["OK", "FAIL", "FAIL_SRPM_INSTALL", "FAIL_DEPS_UNINSTALL", "FAIL_DEPS_INSTALL", "FAIL_NOFILES", "SKIP", "UNSUPP"]:
+ if status not in ["OK", "SKIP", "UNSUPP"] and not status.startswith("FAIL"):
log.panic("xml notification: bad status: %s" % status)
self.batches[id] = status
else:
================================================================
Index: pld-builder.new/PLD_Builder/rpm_builder.py
diff -u pld-builder.new/PLD_Builder/rpm_builder.py:1.68 pld-builder.new/PLD_Builder/rpm_builder.py:1.69
--- pld-builder.new/PLD_Builder/rpm_builder.py:1.68 Fri Feb 27 22:07:29 2009
+++ pld-builder.new/PLD_Builder/rpm_builder.py Fri Feb 27 23:04:43 2009
@@ -135,7 +135,11 @@
r.chroot_files.extend(files)
else:
b.log_line("error: No files produced.")
- res = "FAIL_NOFILES"
+ last_section = util.find_last_section(b.logfile)
+ if last_section == None:
+ res = "FAIL"
+ else:
+ res = "FAIL_%s" % last_section.upper()
b.files = files
chroot.run("rm -rf %s; cd rpm/SPECS; rpmbuild --nodeps --nobuild " \
================================================================
Index: pld-builder.new/PLD_Builder/srpm_builder.py
diff -u pld-builder.new/PLD_Builder/srpm_builder.py:1.52 pld-builder.new/PLD_Builder/srpm_builder.py:1.53
--- pld-builder.new/PLD_Builder/srpm_builder.py:1.52 Fri Feb 27 19:31:41 2009
+++ pld-builder.new/PLD_Builder/srpm_builder.py Fri Feb 27 23:04:43 2009
@@ -103,14 +103,14 @@
if len(files) > 0:
if len(files) > 1:
util.append_to(b.logfile, "error: More than one file produced: %s" % files)
- res = "FAIL"
+ res = "FAIL_TOOMANYFILES"
last = files[len(files) - 1]
b.src_rpm_file = last
b.src_rpm = os.path.basename(last)
r.chroot_files.extend(files)
else:
util.append_to(b.logfile, "error: No files produced.")
- res = "FAIL_NOFILES"
+ res = "FAIL"
if res == 0 and not "test-build" in r.flags:
for pref in config.tag_prefixes:
util.append_to(b.logfile, "Tagging with prefix: %s" % pref)
================================================================
Index: pld-builder.new/PLD_Builder/util.py
diff -u pld-builder.new/PLD_Builder/util.py:1.10 pld-builder.new/PLD_Builder/util.py:1.11
--- pld-builder.new/PLD_Builder/util.py:1.10 Fri Jul 18 13:46:13 2008
+++ pld-builder.new/PLD_Builder/util.py Fri Feb 27 23:04:43 2009
@@ -50,11 +50,23 @@
os.system("rm -f %s/* 2>/dev/null; rmdir %s 2>/dev/null" % (dir, dir))
def collect_files(log):
- f = open(log)
+ f = open(log, 'r')
rx = re.compile(r"^Wrote: (/home.*\.rpm)$")
files = []
for l in f.xreadlines():
m = rx.search(l)
if m:
files.append(m.group(1))
+ f.close()
return files
+
+def find_last_section(log):
+ f = open(log, 'r')
+ rx = re.compile(r"^Executing\(%(\w+)\).*$")
+ last_section = None
+ for l in f:
+ m = rx.search(l)
+ if m:
+ last = m.group(1)
+ f.close()
+ return last_section
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request.py?r1=1.56&r2=1.57&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/rpm_builder.py?r1=1.68&r2=1.69&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/srpm_builder.py?r1=1.52&r2=1.53&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/util.py?r1=1.10&r2=1.11&f=u
More information about the pld-cvs-commit
mailing list