From 8ac35019a376f3d50d33506e2443480fad4a1b86 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 28 Mar 2005 23:05:37 +0000 Subject: [PATCH] Check copyright lines against log git-svn-id: https://svn.dealii.org/trunk@10268 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/scripts/copyright.pl | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 deal.II/common/scripts/copyright.pl diff --git a/deal.II/common/scripts/copyright.pl b/deal.II/common/scripts/copyright.pl new file mode 100644 index 0000000000..b01d1ecddc --- /dev/null +++ b/deal.II/common/scripts/copyright.pl @@ -0,0 +1,62 @@ +###################################################################### +# $Id$ +# +# Copyright +# +###################################################################### +# Check the copyright line of a file against cvs log +# +# Call: perl copyright.pl +###################################################################### + +use strict; + +my $file = $ARGV[0]; + +print "# $file\n"; + +my @log = `cvs log $file`; +my %years; + +foreach (@log) +{ + next unless (m/^date: (\d\d\d\d)/); + my $year = $1; + $years{$year} = 1; +} + +my $copystring; + +foreach (sort keys %years) +{ + if ($copystring) + { + $copystring .= ", $_"; + } else { + $copystring = "$_"; + } +} + +my $copyreg = "Copyright \\(C\\) $copystring by the deal.II authors"; +$copystring = "Copyright (C) $copystring by the deal.II authors"; + +my $found = 0; +my $ok = 0; + +while(<>) +{ + next unless (m/(Copyright.*)/); + my $copyfile = $1; + $found = 1; + if (m/$copyreg/) + { + $ok = 1; + } else { + print "perl -pi~ -e 's/$copyfile/$copystring/;' $file\n"; + } +} + +print "# OK: $copystring\n" if ($ok); + +print "# no copyright found\n" unless ($found); + -- 2.39.5