import time
import datetime
import string
-import urllib
+import urllib.request
+import urllib.parse
+import urllib.error
from config import config, init_conf
from bqueue import B_Queue
import lock
import util
+import shutil
import loop
import path
import status
print("error.reason exception %s" % e)
raise
- o = chroot.popen("cat > %s" % b.src_rpm, mode = "wb")
+ o = chroot.popen("cat > %s" % b.src_rpm, mode = "w")
try:
- bytes = util.sendfile(f, o)
+ shutil.copyfileobj(f, o)
except IOError as e:
b.log_line("error: unable to write to `%s': %s" % (b.src_rpm, e))
raise
+ bytes = float(f.headers['content-length'])
f.close()
o.close()
t = time.time() - start
b.log_line("started at: %s" % time.asctime())
- b.log_line("killing old processes on a builder")
- chroot.run("/bin/kill --verbose -9 -1", logfile = b.logfile)
-
b.log_line("cleaning up /tmp")
chroot.run("rm -rf /tmp/B.*", logfile = b.logfile)