]> git.pld-linux.org Git - projects/pld-builder.new.git/blame - PLD_Builder/maintainer.py
- script for maintaining builders in a good state
[projects/pld-builder.new.git] / PLD_Builder / maintainer.py
CommitLineData
074b4414
MM
1# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
2
3from config import config, init_conf
97c8f39c
MM
4import path
5import os
6import time
7import util
8
9def clean_dir(path, max):
10 curtime=time.time()
11 for i in os.listdir(path):
12 if curtime - os.path.getmtime(path+'/'+i) > max:
13 if os.path.isdir(path+'/'+i):
14 print "rmdir: %s" % path+'/'+i
15 else:
16 print "rmfile: %s" % path+'/'+i
074b4414
MM
17
18def handle_src():
97c8f39c 19 clean_dir(path.www_dir+'srpms', 2592000) # a month
074b4414
MM
20
21def handle_bin():
97c8f39c 22 pass
074b4414
MM
23
24if __name__ == '__main__':
25 init_conf()
26 bb=config.binary_builders[:]
97c8f39c 27 clean_dir(path.spool_dir+'builds', config.max_keep_time)
074b4414
MM
28 if config.src_builder:
29 try:
30 init_conf(config.src_builder)
31 except:
32 pass
33 else:
34 handle_src()
35 for b in bb:
36 try:
37 init_conf(b)
38 except:
39 continue
40 else:
41 handle_bin()
42
This page took 0.045395 seconds and 4 git commands to generate.