summaryrefslogtreecommitdiff
path: root/contrib/update-copyright.pl
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2009-12-17 21:05:15 +0000
committerMorgan Deters <mdeters@gmail.com>2009-12-17 21:05:15 +0000
commitdfcf7dba0b2d8ad6eb9d8540e92804e70205b8fb (patch)
tree6cc700c94a4a72e5f4b758803b079dfed059e054 /contrib/update-copyright.pl
parentfdc93191d331c6bd4a2934eb5cbeb18d78cb078d (diff)
update-copyright.pl now retrieves and incorporates author information from repository history; re-ran update-copyright.pl; cleaned up some things with make
Diffstat (limited to 'contrib/update-copyright.pl')
-rwxr-xr-xcontrib/update-copyright.pl24
1 files changed, 20 insertions, 4 deletions
diff --git a/contrib/update-copyright.pl b/contrib/update-copyright.pl
index 72bc006d7..1548e3fa6 100755
--- a/contrib/update-copyright.pl
+++ b/contrib/update-copyright.pl
@@ -1,5 +1,10 @@
#!/usr/bin/perl -w
#
+# update-copyright.pl
+# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
+#
+# usage: update-copyright [ files/directories... ]
+#
# This script goes through a source directory rewriting the top bits of
# source files to match a template (inline, below). For files with no
# top comment, it adds a fresh one.
@@ -50,12 +55,12 @@ EOF
use strict;
use Fcntl ':mode';
+my $dir = $0;
+$dir =~ s,/[^/]+/*$,,;
+
my @searchdirs = ();
if($#ARGV == -1) {
- my $dir = $0;
- $dir =~ s,/[^/]+/*$,,;
-
- (chdir($dir."/..") && -f "src/include/cvc4_expr.h") || die "can't find top-level source directory for CVC4";
+ (chdir($dir."/..") && -f "src/include/cvc4_config.h") || die "can't find top-level source directory for CVC4";
my $pwd = `pwd`; chomp $pwd;
print <<EOF;
@@ -103,6 +108,11 @@ sub recurse {
my $outfile = $srcdir.'/#'.$file.'.tmp';
open(my $IN, $infile) || die "error opening $infile for reading";
open(my $OUT, '>', $outfile) || die "error opening $outfile for writing";
+ open(my $AUTHOR, "$dir/get-authors " . $infile . '|');
+ my $author = <$AUTHOR>; chomp $author;
+ my $major_contributors = <$AUTHOR>; chomp $major_contributors;
+ my $minor_contributors = <$AUTHOR>; chomp $minor_contributors;
+ close $AUTHOR;
$_ = <$IN>;
if(m,^(%{)?/\*\*\*\*\*,) {
print "updating\n";
@@ -112,6 +122,9 @@ sub recurse {
print $OUT "/********************* -*- C++ -*- */\n";
}
print $OUT "/** $file\n";
+ print $OUT " ** Original author: $author\n";
+ print $OUT " ** Major contributors: $major_contributors\n";
+ print $OUT " ** Minor contributors (to current version): $minor_contributors\n";
print $OUT $standard_template;
print $OUT " **\n";
while(my $line = <$IN>) {
@@ -126,6 +139,9 @@ sub recurse {
print $OUT "/********************* -*- C++ -*- */\n";
}
print $OUT "/** $file\n";
+ print $OUT " ** Original author: $author\n";
+ print $OUT " ** Major contributors: $major_contributors\n";
+ print $OUT " ** Minor contributors (to current version): $minor_contributors\n";
print $OUT $standard_template;
print $OUT " **\n";
print $OUT " ** [[ Add file-specific comments here ]]\n";
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback