/indra/fix-incredibuild.py

https://bitbucket.org/lindenlab/viewer-beta/ · Python · 61 lines · 32 code · 7 blank · 22 comment · 4 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. import sys
  24. import os
  25. import glob
  26. def delete_file_types(path, filetypes):
  27. if os.path.exists(path):
  28. print 'Cleaning: ' + path
  29. orig_dir = os.getcwd();
  30. os.chdir(path)
  31. filelist = []
  32. for type in filetypes:
  33. filelist.extend(glob.glob(type))
  34. for file in filelist:
  35. os.remove(file)
  36. os.chdir(orig_dir)
  37. def main():
  38. build_types = ['*.exp','*.exe','*.pdb','*.idb',
  39. '*.ilk','*.lib','*.obj','*.ib_pdb_index']
  40. pch_types = ['*.pch']
  41. delete_file_types("build-vc80/newview/Release", build_types)
  42. delete_file_types("build-vc80/newview/secondlife-bin.dir/Release/",
  43. pch_types)
  44. delete_file_types("build-vc80/newview/RelWithDebInfo", build_types)
  45. delete_file_types("build-vc80/newview/secondlife-bin.dir/RelWithDebInfo/",
  46. pch_types)
  47. delete_file_types("build-vc80/newview/Debug", build_types)
  48. delete_file_types("build-vc80/newview/secondlife-bin.dir/Debug/",
  49. pch_types)
  50. delete_file_types("build-vc80/test/RelWithDebInfo", build_types)
  51. delete_file_types("build-vc80/test/test.dir/RelWithDebInfo/",
  52. pch_types)
  53. if __name__ == "__main__":
  54. main()