]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/srpm_builder.py
- merged PLD changes, now it works with python 3.x
[tld-builder.git] / TLD_Builder / srpm_builder.py
index c4c48afa9edccb900e129f0fae30a106f1eda4ae..d95dede5c914819c46c54c7d1a494adb1ae249e0 100644 (file)
@@ -4,8 +4,11 @@ import email
 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
@@ -24,6 +27,7 @@ import notify
 import status
 import build
 import report
+#import messagebus
 
 from lock import lock
 from bqueue import B_Queue
@@ -96,6 +100,7 @@ def build_srpm(r, b):
         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\'"
@@ -120,9 +125,9 @@ def build_srpm(r, b):
         util.append_to(b.logfile, "error: No files produced.")
         res = "FAIL"
     if res == 0 and not "test-build" in r.flags:
-        util.append_to(b.logfile, "Writing pkgrev")
-            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)
+        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)
 
@@ -135,6 +140,8 @@ def build_srpm(r, b):
 
     if res:
         res = "FAIL"
+
+#    messagebus.notify(topic="build_srpm.finish", spec=b.spec)
     return res
 
 def handle_request(r):