]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/srpm_builder.py
- python 3.x fixes
[tld-builder.git] / TLD_Builder / srpm_builder.py
index d95dede5c914819c46c54c7d1a494adb1ae249e0..9e45e55e30614d8a35d190a87c3a3dfda27cc875 100644 (file)
@@ -36,7 +36,7 @@ from config import config, init_conf
 def pick_request(q):
     def mycmp(r1, r2):
         if r1.kind != 'group' or r2.kind != 'group':
-            raise Exception, "non-group requests"
+            raise Exception("non-group requests")
         pri_diff = cmp(r1.priority, r2.priority)
         if pri_diff == 0:
             return cmp(r1.time, r2.time)
@@ -55,7 +55,7 @@ def store_binary_request(r):
         return
     r.batches = new_b
     # store new queue and max_req_no for binary builders
-    num = int(string.strip(open(path.max_req_no_file, "r").read())) + 1
+    num = int(open(path.max_req_no_file, "r").read().strip()) + 1
 
     r.no = num
     q = B_Queue(path.req_queue_file)
@@ -75,7 +75,7 @@ def store_binary_request(r):
     cnt_f.flush()
     os.fsync(cnt_f.fileno())
     cnt_f.close()
-    os.chmod(tmpfname, 0644)
+    os.chmod(tmpfname, 0o0644)
     os.rename(tmpfname, path.max_req_no_file)
 
 def transfer_file(r, b):
@@ -83,7 +83,7 @@ def transfer_file(r, b):
     f = b.src_rpm_file
     # export files from chroot
     chroot.cp(f, outfile = local, rm = True)
-    os.chmod(local, 0644)
+    os.chmod(local, 0o0644)
     ftp.add(local)
 
     if config.gen_upinfo and 'test-build' not in r.flags:
@@ -146,7 +146,7 @@ def build_srpm(r, b):
 
 def handle_request(r):
     os.mkdir(path.srpms_dir + '/' + r.id)
-    os.chmod(path.srpms_dir + '/' + r.id, 0755)
+    os.chmod(path.srpms_dir + '/' + r.id, 0o0755)
     ftp.init(r)
     buildlogs.init(r)
     build.build_all(r, build_srpm)