PageRenderTime 36ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 16ms app.codeStats 1ms

/indra/fix-incredibuild.py

https://bitbucket.org/lindenlab/viewer-beta/
Python | 61 lines | 32 code | 7 blank | 22 comment | 6 complexity | a9dcd272b8981edd39929f4b4e525fbd MD5 | raw file
 1#!/usr/bin/env python
 2## 
 3## $LicenseInfo:firstyear=2011&license=viewerlgpl$
 4## Second Life Viewer Source Code
 5## Copyright (C) 2011, Linden Research, Inc.
 6## 
 7## This library is free software; you can redistribute it and/or
 8## modify it under the terms of the GNU Lesser General Public
 9## License as published by the Free Software Foundation;
10## version 2.1 of the License only.
11## 
12## This library is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15## Lesser General Public License for more details.
16## 
17## You should have received a copy of the GNU Lesser General Public
18## License along with this library; if not, write to the Free Software
19## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20## 
21## Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
22## $/LicenseInfo$
23
24import sys
25import os
26import glob
27
28def delete_file_types(path, filetypes):
29    if os.path.exists(path):
30        print 'Cleaning: ' + path
31        orig_dir = os.getcwd();
32        os.chdir(path)
33        filelist = []
34        for type in filetypes:
35            filelist.extend(glob.glob(type))
36        for file in filelist:
37            os.remove(file)
38        os.chdir(orig_dir)
39
40def main():
41    build_types = ['*.exp','*.exe','*.pdb','*.idb',
42                 '*.ilk','*.lib','*.obj','*.ib_pdb_index']
43    pch_types = ['*.pch']
44    delete_file_types("build-vc80/newview/Release", build_types)
45    delete_file_types("build-vc80/newview/secondlife-bin.dir/Release/", 
46                      pch_types)
47    delete_file_types("build-vc80/newview/RelWithDebInfo", build_types)
48    delete_file_types("build-vc80/newview/secondlife-bin.dir/RelWithDebInfo/", 
49                      pch_types)
50    delete_file_types("build-vc80/newview/Debug", build_types)
51    delete_file_types("build-vc80/newview/secondlife-bin.dir/Debug/", 
52                      pch_types)
53
54
55    delete_file_types("build-vc80/test/RelWithDebInfo", build_types)
56    delete_file_types("build-vc80/test/test.dir/RelWithDebInfo/", 
57                      pch_types)
58
59
60if __name__ == "__main__":
61    main()