blob: 5f47476afd710a2ef194f9db9f3330029a4f79a7 [file] [log] [blame]
mbligh8fc0e5a2007-10-11 18:39:03 +00001#!/usr/bin/python
2import os
3
4def purge_src(top_dir):
5 for dir in os.listdir(top_dir):
6 if dir.startswith('.'):
7 continue
8 py = os.path.join (top_dir, dir, dir + '.py')
9 if not os.path.exists(py):
10 continue
11 ret = os.system('grep -q "preserve_srcdir = " ' + py)
12 src_path = os.path.abspath(os.path.join('tests', dir, 'src'))
13 if not os.path.exists(src_path):
14 continue
15 if ret: # This should have a replaceable src dir
16 cmd = 'rm -rf ' + src_path
17 else:
18 cmd = 'cd %s; make clean > /dev/null 2>&1 ' % src_path
19
20 print cmd
21 os.system(cmd)
22
23
mbligh2392ee52007-10-11 19:34:13 +000024for dir in ['tests', 'profilers', 'deps']:
25 purge_src(dir)
mbligh8fc0e5a2007-10-11 18:39:03 +000026