/[pcre]/code/trunk/Detrail
ViewVC logotype

Contents of /code/trunk/Detrail

Parent Directory Parent Directory | Revision Log Revision Log


Revision 111 - (hide annotations) (download)
Thu Mar 8 16:53:09 2007 UTC (7 years, 9 months ago) by ph10
File size: 643 byte(s)
Create the PrepareRelease script to process the documentation and create the 
.generic files for distribution, also to remove trailing spaces. Update a lot 
more of the build-time documentation. Arrange for PrepareRelease and its 
sub-scripts to be distributed.

1 ph10 97 #!/usr/bin/perl
2    
3     # This is a script for removing trailing whitespace from lines in files that
4     # are listed on the command line.
5    
6     # This subroutine does the work for one file.
7    
8     sub detrail {
9 ph10 111 my($file) = $_[0];
10     my($changed) = 0;
11 ph10 97 open(IN, "$file") || die "Can't open $file for input";
12     @lines = <IN>;
13     close(IN);
14 ph10 111 foreach (@lines)
15     {
16     if (/\s+\n$/)
17     {
18     s/\s+\n$/\n/;
19 ph10 97 $changed = 1;
20 ph10 111 }
21 ph10 97 }
22     if ($changed)
23 ph10 111 {
24 ph10 97 open(OUT, ">$file") || die "Can't open $file for output";
25     print OUT @lines;
26     close(OUT);
27 ph10 111 }
28     }
29 ph10 97
30     # This is the main program
31    
32     $, = ""; # Output field separator
33     for ($i = 0; $i < @ARGV; $i++) { &detrail($ARGV[$i]); }
34    
35     # End

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12