svn commit: samba r23597 - in branches/SAMBA_3_0/source/script: .

jerry at samba.org jerry at samba.org
Mon Jun 25 14:40:59 GMT 2007


Author: jerry
Date: 2007-06-25 14:40:59 +0000 (Mon, 25 Jun 2007)
New Revision: 23597

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23597

Log:
add a few utility scripts for code formatting
Added:
   branches/SAMBA_3_0/source/script/count_80_col.pl
   branches/SAMBA_3_0/source/script/strip_trail_ws.pl


Changeset:
Added: branches/SAMBA_3_0/source/script/count_80_col.pl
===================================================================
--- branches/SAMBA_3_0/source/script/count_80_col.pl	2007-06-25 11:45:54 UTC (rev 23596)
+++ branches/SAMBA_3_0/source/script/count_80_col.pl	2007-06-25 14:40:59 UTC (rev 23597)
@@ -0,0 +1,15 @@
+#!/usr/bin/perl -w
+
+open( INFILE, "$ARGV[0]" ) || die $@;
+
+$count = 0;
+while ( <INFILE> ) { 
+	$count++ if (length($_) > 80);
+}
+
+close( INFILE );
+print "$ARGV[0]: $count lines > 80 characters\n" if ($count > 0);
+
+exit( 0 );
+
+


Property changes on: branches/SAMBA_3_0/source/script/count_80_col.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/SAMBA_3_0/source/script/strip_trail_ws.pl
===================================================================
--- branches/SAMBA_3_0/source/script/strip_trail_ws.pl	2007-06-25 11:45:54 UTC (rev 23596)
+++ branches/SAMBA_3_0/source/script/strip_trail_ws.pl	2007-06-25 14:40:59 UTC (rev 23597)
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+
+open( INFILE, "$ARGV[0]" ) || die $@;
+open( OUTFILE, ">$ARGV[0].new" ) || die $@;
+
+while ( <INFILE> ) { 
+	$_ =~ s/[ \t\r]*$//; 
+	print OUTFILE "$_"; 
+}
+
+close( INFILE );
+close( OUTFILE );
+
+rename( "$ARGV[0].new", "$ARGV[0]" ) || die @_;
+
+exit( 0 );
+
+


Property changes on: branches/SAMBA_3_0/source/script/strip_trail_ws.pl
___________________________________________________________________
Name: svn:executable
   + *



More information about the samba-cvs mailing list