Line | |
---|
1 | #!/usr/bin/perl -ws
|
---|
2 |
|
---|
3 | # curliff.pl - convert certain files in the Perl distribution that
|
---|
4 | # need to be in CR-LF format to CR-LF, or back to LF format (with the
|
---|
5 | # -r option). The CR-LF format is NOT to be used for checking in
|
---|
6 | # files to the Perforce repository, but it IS to be used when making
|
---|
7 | # Perl snapshots or releases.
|
---|
8 |
|
---|
9 | use strict;
|
---|
10 |
|
---|
11 | use vars qw($r);
|
---|
12 |
|
---|
13 | my @FILES = qw(
|
---|
14 | djgpp/configure.bat
|
---|
15 | README.ce
|
---|
16 | README.dos
|
---|
17 | README.win32
|
---|
18 | win32/Makefile
|
---|
19 | win32/makefile.mk
|
---|
20 | wince/compile-all.bat
|
---|
21 | wince/README.perlce
|
---|
22 | wince/registry.bat
|
---|
23 | );
|
---|
24 |
|
---|
25 | {
|
---|
26 | local($^I, @ARGV) = ('.orig', @FILES);
|
---|
27 | while (<>) {
|
---|
28 | if ($r) {
|
---|
29 | s/\015\012/\012/; # Curliffs to liffs.
|
---|
30 | } else {
|
---|
31 | s/\015?\012/\015\012/; # Curliffs and liffs to curliffs.
|
---|
32 | }
|
---|
33 | print;
|
---|
34 | close ARGV if eof; # Reset $.
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.