import string
import time
import os
-import StringIO
import sys
+if sys.version_info[0] == 2:
+ import StringIO
+else:
+ from io import StringIO
import re
import shutil
import atexit
import status
import build
import report
+#import messagebus
from lock import lock
from bqueue import B_Queue
return "FAIL"
status.push("building %s" % b.spec)
+# messagebus.notify(topic="build_srpm.start", spec=b.spec, flags=r.flags, batch=b, request=r)
b.src_rpm = ""
builder_opts = "-nu -nm --nodeps --http --define \'_tld_builder 1\'"
- if ("test-build" in r.flags):
- tag_test=""
- else:
- tag_test=" -Tp %s -tt" % (config.tag_prefixes[0],)
- cmd = ("cd rpm/packages; nice -n %s ./builder %s -bs %s -r %s %s %s %s %s 2>&1" %
+ cmd = ("cd rpm/packages; nice -n %s ./builder %s -bs %s -r %s %s %s %s 2>&1" %
(config.nice, builder_opts, b.bconds_string(), b.branch,
- tag_test, b.kernel_string(), b.defines_string(), b.spec))
+ b.kernel_string(), b.defines_string(), b.spec))
util.append_to(b.logfile, "request from: %s" % r.requester)
util.append_to(b.logfile, "started at: %s" % time.asctime())
util.append_to(b.logfile, "building SRPM using: %s\n" % cmd)
util.append_to(b.logfile, "error: No files produced.")
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)
- res = chroot.run("cd rpm/packages; ./builder -bs -r %s -Tp %s -Tv --pkgrev %s" % \
- (b.bconds_string(), b.branch, pref, b.defines_string(), b.spec), logfile = b.logfile)
+ util.append_to(b.logfile, "Writing package revision")
+ res = chroot.run("cd rpm/packages; ./builder -bs %s -r %s --pkgrev %s %s" % \
+ (b.bconds_string(), b.branch, b.defines_string(), b.spec), logfile = b.logfile)
if res == 0:
transfer_file(r, b)
if res:
res = "FAIL"
+
+# messagebus.notify(topic="build_srpm.finish", spec=b.spec)
return res
def handle_request(r):