aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/protobuf/py3/patches/z_00_yandex_src_migration.sh
blob: 3c743d7732a88a7006f552a90219fc9ad2b6f110 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cat << EOF > fix.py
import sys

def fix_line(l):
    l = l.replace('absl/', 'y_absl/')
    l = l.replace('absl::', 'y_absl::')
    l = l.replace('ABSL_', 'Y_ABSL_')
    l = l.replace('std::string', 'TProtoStringType')

    return l

print('\n'.join(fix_line(x) for x in sys.stdin.read().split('\n')).strip())
EOF

(
    find . -type f -name '*.cc'
    find . -type f -name '*.h'
) | while read l; do
    cat ${l} | python3 ./fix.py > _
    mv _ ${l}
done

rm fix.py