pld-builder.new: PLD_Builder/request.py, PLD_Builder/request_handler.py - s...

glen glen at pld-linux.org
Thu Feb 4 17:36:32 CET 2010


Author: glen                         Date: Thu Feb  4 16:36:32 2010 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- skip requests implementation

---- Files affected:
pld-builder.new/PLD_Builder:
   request.py (1.69 -> 1.70) , request_handler.py (1.49 -> 1.50) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/request.py
diff -u pld-builder.new/PLD_Builder/request.py:1.69 pld-builder.new/PLD_Builder/request.py:1.70
--- pld-builder.new/PLD_Builder/request.py:1.69	Wed Oct 28 16:34:24 2009
+++ pld-builder.new/PLD_Builder/request.py	Thu Feb  4 17:36:27 2010
@@ -138,6 +138,7 @@
         self.spec = ""
         self.command = ""
         self.command_flags = []
+        self.skip = []
         self.gb_id = ""
         self.b_id = attr(e, "id")
         self.depends_on = string.split(attr(e, "depends-on"))
@@ -162,6 +163,8 @@
                 self.kernel = text(c)
             elif c.nodeName == "target":
                 self.target.append(text(c))
+            elif c.nodeName == "skip":
+                self.skip.append(text(c))
             elif c.nodeName == "branch":
                 self.branch = text(c)
             elif c.nodeName == "builder":

================================================================
Index: pld-builder.new/PLD_Builder/request_handler.py
diff -u pld-builder.new/PLD_Builder/request_handler.py:1.49 pld-builder.new/PLD_Builder/request_handler.py:1.50
--- pld-builder.new/PLD_Builder/request_handler.py:1.49	Wed Oct 28 16:34:24 2009
+++ pld-builder.new/PLD_Builder/request_handler.py	Thu Feb  4 17:36:27 2010
@@ -54,7 +54,6 @@
     if check_double_id(r.id):
         lockf.close()
         return
-        
 
     for batch in r.batches:
         if not user.can_do("src", config.builder, batch.branch):
@@ -80,6 +79,26 @@
         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)
 
@@ -174,7 +193,7 @@
         return False
 
     acl.set_current_user(user)
-    status.push("email from %s" % user.login)
+    status.push("request from %s" % user.login)
     r = request.parse_request(body)
     if r.kind == 'group':
         handle_group(r, user)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request.py?r1=1.69&r2=1.70&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request_handler.py?r1=1.49&r2=1.50&f=u



More information about the pld-cvs-commit mailing list