import log
import buildlogs
import status
+from config import config, init_conf
+
def run_command(batch):
if "no-chroot" in batch.command_flags:
- user = "root"
- if "as-builder" in batch.command_flags:
- user = "builder"
- return chroot.run(batch.command, logfile = batch.logfile, user = user)
- else:
- c = "%s >> %s 2>&1" % (batch.command, logfile)
+ c = "%s >> %s 2>&1" % (batch.command, batch.logfile)
f = os.popen(c)
for l in f.xreadlines():
pass
return 0
else:
return r
+ else:
+ user = "root"
+ if "as-builder" in batch.command_flags:
+ user = "builder"
+ return chroot.run(batch.command, logfile = batch.logfile, user = user)
def build_all(r, build_fnc):
status.email = r.requester_email
failed_dep = dep.spec
if batch.is_command() and can_build:
- batch.logfile = tmp + batch.spec + ".log"
+ batch.logfile = tmp + "command"
if config.builder in batch.builders:
log.notice("running %s" % batch.command)
stopwatch.start()
info_from_log(b, m)
for b in r.batches:
- if b.build_failed and b.logfile != None:
+ if (b.is_command () or b.build_failed) and b.logfile != None:
m.write("\n\n*** buildlog for %s\n" % b.spec)
m.append_log(b.logfile)
m.write("\n\n")
self.src_rpm = text(c)
elif c.nodeName == "spec":
self.spec = text(c)
- elif c.nodeName == "command"
+ elif c.nodeName == "command":
+ self.spec = "COMMAND"
self.command = text(c)
self.command_flags = string.split(attr(c, "flags", ""))
elif c.nodeName == "info":
f.write("<li>\n")
if self.is_command():
desc = "SH: %s [%s]" % (self.command, ' '.join(self.command_flags))
- else
+ else:
desc = "%s (%s -R %s %s)" % \
(self.src_rpm, self.spec, self.branch, self.bconds_string())
f.write("%s <small>[" % desc)
batch.builders.remove(config.builder)
for bld in batch.builders:
batch.builders_status[bld] = '?'
- if bld not in config.binary_builders:
+ if bld not in config.binary_builders and bld != config.builder:
fail_mail("I (src rpm builder '%s') do not handle binary builder '%s', only '%s'" % \
(config.builder, bld, string.join(config.binary_builders)))
return