| 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 | # This list is also in makerel. |
| 14 | my @FILES = qw( |
| 15 | djgpp/configure.bat |
| 16 | README.ce |
| 17 | README.dos |
| 18 | README.symbian |
| 19 | README.win32 |
| 20 | symbian/config.pl |
| 21 | symbian/makesis.pl |
| 22 | symbian/README |
| 23 | symbian/xsbuild.pl |
| 24 | win32/Makefile |
| 25 | win32/makefile.mk |
| 26 | wince/Makefile.ce |
| 27 | wince/compile-all.bat |
| 28 | wince/README.perlce |
| 29 | wince/registry.bat |
| 30 | ); |
| 31 | |
| 32 | { |
| 33 | local($^I, @ARGV) = ('.orig', @FILES); |
| 34 | while (<>) { |
| 35 | if ($r) { |
| 36 | s/\015\012/\012/; # Curliffs to liffs. |
| 37 | } else { |
| 38 | s/\015?\012/\015\012/; # Curliffs and liffs to curliffs. |
| 39 | } |
| 40 | print; |
| 41 | close ARGV if eof; # Reset $. |
| 42 | } |
| 43 | } |