equal
deleted
inserted
replaced
1 #!/usr/bin/perl |
1 #!/usr/bin/perl |
2 |
2 |
3 use Getopt::Long; |
3 use Getopt::Long; |
4 |
4 |
5 use constant TOOL_VERSION=>"0.1"; |
5 use constant TOOL_VERSION=>"0.2"; |
6 |
6 |
7 my $help; |
7 my $help; |
8 my $dir; |
8 my $dir; |
9 my $convert; |
9 my $convert; |
10 my $logfile; |
10 my $logfile; |
63 open (DST, ">$dst") if($convert); |
63 open (DST, ">$dst") if($convert); |
64 |
64 |
65 my $line; |
65 my $line; |
66 while($line = <SRC>) |
66 while($line = <SRC>) |
67 { |
67 { |
68 if ($line =~ /[\\\/]epoc32/) |
68 if ($line =~ /[\\\/]epoc32[\\\/]/i) |
69 { |
69 { |
70 print "Found content in file $src\n"; |
70 print "Found content in file $src\n"; |
71 print LOG "Found content in file $src\n"; |
71 print LOG "Found content in file $src\n"; |
72 print "current line is $line"; |
72 print "current line is $line"; |
73 print LOG "current line is $line"; |
73 print LOG "current line is $line"; |
74 if ($line =~ /EPOCROOT##[\\\/]?epoc32/) |
74 if ($line =~ /EPOCROOT##[\\\/]?epoc32[\\\/]/i) |
75 { |
75 { |
76 print "Error: this line already contain EPOCROOT\n"; |
76 print "Error: this line already contain EPOCROOT\n"; |
77 next; |
77 next; |
78 } |
78 } |
79 if($convert) |
79 if($convert) |
80 { |
80 { |
81 $line =~ s-[\\\/]epoc32-EPOCROOT##epoc32-g; |
81 $line =~ s-[\\\/]epoc32(?=[\\\/])-EPOCROOT##epoc32-ig; |
82 print "converted line is $line"; |
82 print "converted line is $line"; |
83 print LOG "converted line is $line"; |
83 print LOG "converted line is $line"; |
84 } |
84 } |
85 print "\n"; |
85 print "\n"; |
86 print LOG "\n"; |
86 print LOG "\n"; |