pld-builder.new: PLD_Builder/build.py, PLD_Builder/request_handler.py - dif...

glen glen at pld-linux.org
Mon Feb 8 21:36:39 CET 2010


Author: glen                         Date: Mon Feb  8 20:36:39 2010 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- different approach: skip command into shell commands

---- Files affected:
pld-builder.new/PLD_Builder:
   build.py (1.13 -> 1.14) , request_handler.py (1.50 -> 1.51) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/build.py
diff -u pld-builder.new/PLD_Builder/build.py:1.13 pld-builder.new/PLD_Builder/build.py:1.14
--- pld-builder.new/PLD_Builder/build.py:1.13	Tue Apr  7 16:23:26 2009
+++ pld-builder.new/PLD_Builder/build.py	Mon Feb  8 21:36:34 2010
@@ -16,9 +16,24 @@
 from config import config, init_conf
 
 
+
 def run_command(batch):
+    # we want to keep "skip" in queue.html
+    command = batch.command
+
+    # rewrite special "skip:BUILD_ID into touch
+    if command[:5] == "skip:":
+        c = "set -x; echo SKIPME; echo SKIPME >&2;"
+        for id in command[5:].split(','):
+            if os.path.isdir(path.srpms_dir + '/' + id):
+                c = c + "echo skip:%s;\n" % (id)
+                c = c + "touch %s/%s;\n" % (path.srpms_dir, id)
+            else:
+                c = c + "echo %s is not valid build-id;\n" % (id)
+        command = c
+
     if "no-chroot" in batch.command_flags:
-        c = "%s >> %s 2>&1" % (batch.command, batch.logfile)
+        c = "%s >> %s 2>&1" % (command, batch.logfile)
         f = os.popen(c)
         for l in f.xreadlines():
             pass
@@ -31,7 +46,7 @@
         user = "root"
         if "as-builder" in batch.command_flags:
             user = "builder"
-        return chroot.run(batch.command, logfile = batch.logfile, user = user)
+        return chroot.run(command, logfile = batch.logfile, user = user)
 
 def build_all(r, build_fnc):
     status.email = r.requester_email

================================================================
Index: pld-builder.new/PLD_Builder/request_handler.py
diff -u pld-builder.new/PLD_Builder/request_handler.py:1.50 pld-builder.new/PLD_Builder/request_handler.py:1.51
--- pld-builder.new/PLD_Builder/request_handler.py:1.50	Thu Feb  4 17:36:27 2010
+++ pld-builder.new/PLD_Builder/request_handler.py	Mon Feb  8 21:36:34 2010
@@ -56,6 +56,7 @@
         return
 
     for batch in r.batches:
+
         if not user.can_do("src", config.builder, batch.branch):
             fail_mail("user %s is not allowed to src:%s:%s" \
                         % (user.get_login(), config.builder, batch.branch))
@@ -74,30 +75,10 @@
             return
 
         # src builder handles only special commands
-        if batch.is_command() and (batch.command in ["cvs up"] or config.builder in batch.builders):
+        if batch.is_command() and (batch.command in ["cvs up"] or batch.command[:5] == "skip:"  or config.builder in batch.builders):
             batch.expand_builders(config.binary_builders + [config.src_builder])
         else:
             batch.expand_builders(config.binary_builders)
-
-        if batch.skip:
-            msg = ""
-            for id in batch.skip:
-                if os.path.isdir(path.srpms_dir + '/' + id):
-                    fd = open(path.srpms_dir + '/' + id + '/skipme', 'w')
-                    fd.write("skip request %s" % (user.get_login()))
-                    fd.close()
-                    log.notice("skip request %s by %s" % (id, user.get_login()))
-                    msg = msg + "skip %s\n" % id
-                else:
-                    msg = msg + "no srpm dir for %s\n" % id
-
-            m = user.message_to()
-            m.set_headers(subject = "skip request")
-            m.write_line(msg)
-            m.send()
-
-            lockf.close()
-            return
 
         if not batch.is_command() and config.builder in batch.builders:
             batch.builders.remove(config.builder)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/build.py?r1=1.13&r2=1.14&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request_handler.py?r1=1.50&r2=1.51&f=u



More information about the pld-cvs-commit mailing list