kt_copy.py 528 B

1234567891011121314151617
  1. #!/usr/bin/env python
  2. import sys
  3. if __name__ == '__main__':
  4. source = sys.argv[1]
  5. destination = sys.argv[2]
  6. source_root = sys.argv[3]
  7. build_root = sys.argv[4]
  8. with open(source, 'r') as afile:
  9. src_content = afile.read()
  10. src_content = src_content.replace(source_root + '/', "")
  11. result_srcs = ""
  12. for line in src_content.split("\n"):
  13. if not line.startswith(build_root):
  14. result_srcs += line + "\n"
  15. with open(destination, 'w') as afile:
  16. afile.write(result_srcs)