Project

General

Profile

« Previous | Next » 

Revision 10448

bin/my2pg: use s!...!...! when either the regexp or the replacement contains / , to avoid unnecessary \-s

View differences:

bin/my2pg
15 15

  
16 16
sed \
17 17
-e 's/`/"/g' \
18
-e 's/ UNIQUE KEY ("[^"]*")/ \/*CONSTRAINT \1 *\/UNIQUE/g' \
18
-e 's! UNIQUE KEY ("[^"]*")! /*CONSTRAINT \1 */UNIQUE!g' \
19 19
-e 's/ UNIQUE KEY/ UNIQUE/g' \
20
-e 's/^  ((CONSTRAINT "[^"]*" )?((FULLTEXT|FOREIGN) )?KEY .*[^,])(,?)$/  \/*\1*\/CHECK (true)\5/' \
21
-e "s/\/\*.* (SET NAMES )([0-9A-Za-z_]+) \*\/;/\1'\2';/" \
20
-e 's!^  ((CONSTRAINT "[^"]*" )?((FULLTEXT|FOREIGN) )?KEY .*[^,])(,?)$!  /*\1*/CHECK (true)\5!' \
21
-e "s!/\*.* (SET NAMES )([0-9A-Za-z_]+) \*/;!\1'\2';!" \
22 22
-e 's/ (CHARACTER SET|COLLATE) [0-9A-Za-z_]+//g' \
23 23
-e "s! (COMMENT '.*')! /*\1*/!g
24 24
# COMMENTs never span multiple lines because newlines are encoded as \n" \

Also available in: Unified diff