Author: mmazur                       Date: Sun Feb 20 11:58:18 2005 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- script for maintaining builders in a good state

---- Files affected:
pld-builder.new/PLD_Builder:
   maintainer.py (NONE -> 1.1)  (NEW), config.py (1.26 -> 1.27) , cleaner.py 
(1.1 -> NONE)  (REMOVED)
pld-builder.new/bin:
   maintainer.sh (NONE -> 1.1)  (NEW), cleaner.sh (1.1 -> NONE)  (REMOVED)

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/maintainer.py
diff -u /dev/null pld-builder.new/PLD_Builder/maintainer.py:1.1
--- /dev/null   Sun Feb 20 12:58:18 2005
+++ pld-builder.new/PLD_Builder/maintainer.py   Sun Feb 20 12:58:13 2005
@@ -0,0 +1,42 @@
+# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
+
+from config import config, init_conf
+import path
+import os
+import time
+import util
+
+def clean_dir(path, max):
+    curtime=time.time()
+    for i in os.listdir(path):
+        if curtime - os.path.getmtime(path+'/'+i) > max:
+            if os.path.isdir(path+'/'+i):
+                print "rmdir: %s" % path+'/'+i
+            else:
+                print "rmfile: %s" % path+'/'+i
+
+def handle_src():
+    clean_dir(path.www_dir+'srpms', 2592000) # a month
+
+def handle_bin():
+    pass
+
+if __name__ == '__main__':
+    init_conf()
+    bb=config.binary_builders[:]
+    clean_dir(path.spool_dir+'builds', config.max_keep_time)
+    if config.src_builder:
+        try:
+            init_conf(config.src_builder)
+        except:
+            pass
+        else:
+            handle_src()
+    for b in bb:
+        try:
+            init_conf(b)
+        except:
+            continue
+        else:
+            handle_bin()
+

================================================================
Index: pld-builder.new/PLD_Builder/config.py
diff -u pld-builder.new/PLD_Builder/config.py:1.26 
pld-builder.new/PLD_Builder/config.py:1.27
--- pld-builder.new/PLD_Builder/config.py:1.26  Thu Feb 17 23:53:28 2005
+++ pld-builder.new/PLD_Builder/config.py       Sun Feb 20 12:58:13 2005
@@ -64,6 +64,7 @@
         self.binary_builders = string.split(get("binary_builders"))
         self.src_builder = string.strip(get("src_builder", ""))
         self.tag_prefixes = string.split(get("tag_prefixes", ""))
+        self.max_keep_time = get("max_keep_time", 168)*60*60
         self.bot_email = get("bot_email", "")
         self.control_url = get("control_url")
         self.notify_email = get("notify_email")

================================================================
Index: pld-builder.new/bin/maintainer.sh
diff -u /dev/null pld-builder.new/bin/maintainer.sh:1.1
--- /dev/null   Sun Feb 20 12:58:18 2005
+++ pld-builder.new/bin/maintainer.sh   Sun Feb 20 12:58:13 2005
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+umask 022
+export LC_CTYPE=en_US.iso-8859-1
+cd ~/pld-builder.new
+python PLD_Builder/maintainer.py
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/pld-builder.new/PLD_Builder/config.py?r1=1.26&r2=1.27&f=u


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

Reply via email to