z_00_yandex_src_migration.sh 466 B

1234567891011121314151617181920212223
  1. cat << EOF > fix.py
  2. import sys
  3. def fix_line(l):
  4. l = l.replace('absl/', 'y_absl/')
  5. l = l.replace('absl::', 'y_absl::')
  6. l = l.replace('ABSL_', 'Y_ABSL_')
  7. l = l.replace('std::string', 'TProtoStringType')
  8. return l
  9. print('\n'.join(fix_line(x) for x in sys.stdin.read().split('\n')).strip())
  10. EOF
  11. (
  12. find . -type f -name '*.cc'
  13. find . -type f -name '*.h'
  14. ) | while read l; do
  15. cat ${l} | python3 ./fix.py > _
  16. mv _ ${l}
  17. done
  18. rm fix.py