From f17b50f9007d5550b96ec18e938e8b6c60e86bbb Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Thu, 29 Jan 2004 22:40:13 +0000 Subject: [PATCH] Script to update licenses from 1.1 to 2.0 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197298 13f79535-47bb-0310-9956-ffa450edef68 --- bin/lic_to_2 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 bin/lic_to_2 diff --git a/bin/lic_to_2 b/bin/lic_to_2 new file mode 100644 index 000000000..eb36e3ac8 --- /dev/null +++ b/bin/lic_to_2 @@ -0,0 +1,40 @@ +#!/usr/bin/perl + +use Getopt::Long; + +sub usage { + print STDERR "Usage:\n"; + print STDERR "\t$0 --lic2 \n"; + exit 1; +} + +&usage unless GetOptions("lic2=s" => \$lic2); +&usage unless defined($lic2); + +die "Can't open $lic2\n" unless open LIC2, "<$lic2"; + +# Read files without an input record separator +undef $/; + +# Slurp the license file +$lic2text = ; +($lic2begin = $lic2text) =~ s/^(.*)\{YEARS\}(.*)/$1/s; +$lic2rem = $2; + +# Slurp the input file +$_ = <>; +s|\n # Start with a newline + [^\n]*=+\s+ # Non-newlines followed by multiple '=' + # ...followed by whitespace (incl. newline) + [^\n]* # Non-newlines (incl spaces) + The\ Apache\ Software\ License,\ Version\ 1\.1 + .* # Anything + Copyright\ \(C\)\ (\d+(-\d+)?)\ The\ Apache\ Software\ Foundation + .* # Anything + James\ Tauber + .* # Anything + \\. + \s+ # Any whitespace +|$lic2begin$1$lic2rem|xs; + +print; -- 2.39.5