Author: arekm                        Date: Sat Nov 13 22:46:01 2010 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
mkstemp returns file descriptor, convert to file object

---- Files affected:
pld-builder.new/PLD_Builder:
   bqueue.py (1.20 -> 1.21) , srpm_builder.py (1.74 -> 1.75) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/bqueue.py
diff -u pld-builder.new/PLD_Builder/bqueue.py:1.20 
pld-builder.new/PLD_Builder/bqueue.py:1.21
--- pld-builder.new/PLD_Builder/bqueue.py:1.20  Sat Nov 13 23:31:13 2010
+++ pld-builder.new/PLD_Builder/bqueue.py       Sat Nov 13 23:45:56 2010
@@ -22,7 +22,8 @@
         self.fd = None
 
     def dump(self, fname):
-        (f, tmpfname) = tempfile.mkstemp(dir=os.path.dirname(fname))
+        (fdno, tmpfname) = tempfile.mkstemp(dir=os.path.dirname(fname))
+        f = os.fdopen(fdno)
         self.requests.reverse()
         for r in self.requests:
             r.dump(f)
@@ -34,7 +35,8 @@
         os.rename(tmpfname, fname)
 
     def dump_html(self, fname):
-        (f, tmpfname) = tempfile.mkstemp(dir=os.path.dirname(fname))
+        (fdno, tmpfname) = tempfile.mkstemp(dir=os.path.dirname(fname))
+        f = os.fdopen(fdno)
         f.write("""
 <html>
     <head>
@@ -120,7 +122,8 @@
         sio.seek(0)
         sio.write(gpg.sign(sio.read()))
         sio.seek(0)
-        (f, tmpname) = tempfile.mkstemp(dir=os.path.dirname(name))
+        (fdno, tmpname) = tempfile.mkstemp(dir=os.path.dirname(name))
+        f = os.fdopen(fdno)
         if re.search(r"\.gz$", name):
             fgz = gzip.GzipFile(filename=name, mode="w", compresslevel=6, 
fileobj=f)
             util.sendfile(sio, fgz)

================================================================
Index: pld-builder.new/PLD_Builder/srpm_builder.py
diff -u pld-builder.new/PLD_Builder/srpm_builder.py:1.74 
pld-builder.new/PLD_Builder/srpm_builder.py:1.75
--- pld-builder.new/PLD_Builder/srpm_builder.py:1.74    Sat Nov 13 22:55:47 2010
+++ pld-builder.new/PLD_Builder/srpm_builder.py Sat Nov 13 23:45:56 2010
@@ -64,7 +64,8 @@
     q.write_signed(path.req_queue_signed_file)
     q.unlock()
 
-    (cnt_f, tmpfname) = 
tempfile.mkstemp(dir=os.path.dirname(path.max_req_no_file))
+    (fdno, tmpfname) = 
tempfile.mkstemp(dir=os.path.dirname(path.max_req_no_file))
+    cnt_f = os.fdopen(fdno)
     cnt_f.seek(0)
     cnt_f.write("%d\n" % num)
     cnt_f.flush()
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/bqueue.py?r1=1.20&r2=1.21&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/srpm_builder.py?r1=1.74&r2=1.75&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to