You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2006/08/16 06:21:14 UTC

svn commit: r431794 - /spamassassin/trunk/build/replace_license_blocks

Author: felicity
Date: Tue Aug 15 21:21:14 2006
New Revision: 431794

URL: http://svn.apache.org/viewvc?rev=431794&view=rev
Log:
update replace_license_blocks, have it deal with C-style comments better, put a sample commandline in place

Modified:
    spamassassin/trunk/build/replace_license_blocks

Modified: spamassassin/trunk/build/replace_license_blocks
URL: http://svn.apache.org/viewvc/spamassassin/trunk/build/replace_license_blocks?rev=431794&r1=431793&r2=431794&view=diff
==============================================================================
--- spamassassin/trunk/build/replace_license_blocks (original)
+++ spamassassin/trunk/build/replace_license_blocks Tue Aug 15 21:21:14 2006
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -i.bak
+#!/usr/bin/perl -i
 #
 # build/replace_license_blocks file ...
 #
@@ -10,6 +10,12 @@
 #     * <@LICENSE>
 #
 # will result in all lines of the license text being prefixed with "    * ".
+#
+# do something like the following:
+# - create a "newlicense" file with the license text as appropriate
+# - run something like:
+#   grep -rl @LICENSE * | egrep -v 'replace_license_blocks|\.svn' | xargs build/replace_license_blocks
+#
 
 # read the new license text; die if not available
 open (IN, "<newlicense") or die "cannot read 'newlicense'";
@@ -43,9 +49,14 @@
 
 sub license_with_prefix {
   my $prefix = shift;
+
+  # if the prefix is "/*" replace with " *"
+  my $orig = $prefix;
+  $prefix =~ s@^(\s*)/\*(.*)$@$1 *$2@;
+
   my $text = $license; $text =~ s/^/$prefix/gm;
 
-  return $prefix."<\...@LICENSE>\n".
+  return $orig."<\...@LICENSE>\n".
     $text.
     $prefix."</\...@LICENSE>\n";
 }