httpd-win32-msi-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-win32-msi unixtodos.pl
Date Thu, 08 Mar 2001 04:53:59 GMT
wrowe       01/03/07 20:53:59

  Added:       .        unixtodos.pl
  Log:
    Just a handy place to stow this, since it's only used for comparing
    the .zip to the .tar.gz when I roll .zip sources.
  
  Revision  Changes    Path
  1.1                  httpd-win32-msi/unixtodos.pl
  
  Index: unixtodos.pl
  ===================================================================
  use IO::File;
  use File::Find;
  
  $ignore = "-gif-jpg-fig-ico-gz-mcp-xdc-opt-ucs2-ucs4-";
  find(\&totxt, '.');
  
  sub totxt {
          $oname = $_;
  	$tname = '.#' . $_;
          if (!-f) {
              return;
          }
  	@exts = split /\./;
          while ($#exts && ($ext = pop(@exts))) {
              if ($ignore =~ m|-$ext-|i) {
                  return;
              }
  	}
  	$srcfl = new IO::File $oname, "r" || die;
  	$dstfl = new IO::File $tname, "w" || die;
          binmode $srcfl;
          while (<$srcfl>) { 
              while (s/\r\n$/\n/) {
                  ;
              }
  	    print $dstfl $_; 
  	}
  	undef $srcfl;
  	undef $dstfl;
  	unlink $oname || die;
  	rename $tname, $oname || die;
  	print "Converted file " . $oname . " to text in " . $File::Find::dir . "\n"; 
  }
  
  
  

Mime
View raw message