diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2007-08-17 20:56:39 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2007-08-17 20:56:39 +0000 |
commit | ded17d10f60c1ac6312b44605add2a828dd16605 (patch) | |
tree | 1af060b0013e999e53c7f0312a0f3256ac3352e4 /build/lineends.pl | |
parent | ed8b8d3688f77f98e6a8894d48ca54cc3686e8c5 (diff) | |
download | apr-ded17d10f60c1ac6312b44605add2a828dd16605.tar.gz |
More de-tabification.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@567139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/lineends.pl')
-rw-r--r-- | build/lineends.pl | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/build/lineends.pl b/build/lineends.pl index 8d9b2d97b..3e3067f76 100644 --- a/build/lineends.pl +++ b/build/lineends.pl @@ -63,22 +63,22 @@ while (defined @ARGV[0]) { } elsif (@ARGV[0] =~ m/^-/) { die "What is " . @ARGV[0] . " supposed to mean?\n\n" - . "Syntax:\t$0 [option()s] [path(s)]\n\n" . <<'OUTCH' -Where: paths specifies the top level directory to convert (default of '.') - options are; + . "Syntax:\t$0 [option()s] [path(s)]\n\n" . <<'OUTCH' +Where: paths specifies the top level directory to convert (default of '.') + options are; - --cr keep/add one ^M - --nocr remove ^M's - --touch the datestamp (default: keeps date/attribs) - --force mismatched corrections (unbalanced ^M's) - --FORCE all files regardless of file name! + --cr keep/add one ^M + --nocr remove ^M's + --touch the datestamp (default: keeps date/attribs) + --force mismatched corrections (unbalanced ^M's) + --FORCE all files regardless of file name! OUTCH } else { find(\&totxt, @ARGV[0]); - print "scanned " . @ARGV[0] . "\n"; - $givenpaths = 1; + print "scanned " . @ARGV[0] . "\n"; + $givenpaths = 1; } shift @ARGV; } @@ -90,50 +90,50 @@ if (!$givenpaths) { sub totxt { $oname = $_; - $tname = '.#' . $_; + $tname = '.#' . $_; if (!-f) { return; } - @exts = split /\./; - if ($forceending < 2) { + @exts = split /\./; + if ($forceending < 2) { while ($#exts && ($ext = pop(@exts))) { if ($ignore =~ m|-$ext-|i) { return; } - } + } } return if ($File::Find::dir =~ m|^(.+/)?.svn(/.+)?$|); - @ostat = stat($oname); + @ostat = stat($oname); $srcfl = new IO::File $oname, "r" or die; - $dstfl = new IO::File $tname, "w" or die; + $dstfl = new IO::File $tname, "w" or die; binmode $srcfl; - if ($notnative) { + if ($notnative) { binmode $dstfl; - } - undef $t; + } + undef $t; while (<$srcfl>) { if (s/(\r*)\n$/\n/) { - $n = length $1; - if (!defined $t) { - $t = $n; - } - if (!$forceending && (($n != $t) || m/\r/)) { - print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n"; - undef $t; - last; - } - elsif ($notnative > 0) { + $n = length $1; + if (!defined $t) { + $t = $n; + } + if (!$forceending && (($n != $t) || m/\r/)) { + print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n"; + undef $t; + last; + } + elsif ($notnative > 0) { s/\n$/\r\n/; } } - print $dstfl $_; - } - if (defined $t && (tell $srcfl == tell $dstfl)) { - undef $t; - } - undef $srcfl; - undef $dstfl; - if (defined $t) { + print $dstfl $_; + } + if (defined $t && (tell $srcfl == tell $dstfl)) { + undef $t; + } + undef $srcfl; + undef $dstfl; + if (defined $t) { unlink $oname or die; rename $tname, $oname or die; @anames = ($oname); @@ -143,8 +143,8 @@ sub totxt { chmod $ostat[2] & 07777, @anames; chown $ostat[5], $ostat[6], @anames; print "Converted file " . $oname . " to text in " . $File::Find::dir . "\n"; - } - else { - unlink $tname or die; - } + } + else { + unlink $tname or die; + } } |