#!/usr/bin/perl -w
#
# update-copyright.pl
-# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
-# Copyright (c) 2009-2014 The CVC4 Project
+# Copyright (c) 2009-2018 The CVC4 Project
#
# usage: update-copyright [-m] [files/directories...]
# update-copyright [-h | --help]
# the license.)
#
-my $excluded_directories = '^(minisat|bvminisat|CVS|generated)$';
-my $excluded_paths = '^(src/parser/antlr_input_imports.cpp|src/bindings/compat/.*|src/util/channel.h)$';
+my $excluded_directories = '^(CVS|generated)$';
+my $excluded_paths = '^(';
+# note: first excluded path regexp must not start with a '|'
+# different license
+$excluded_paths .= 'src/util/channel.h';
+# minisat license
+$excluded_paths .= '|src/prop/(bv)?minisat/core/.*';
+$excluded_paths .= '|src/prop/(bv)?minisat/mtl/.*';
+$excluded_paths .= '|src/prop/(bv)?minisat/simp/.*';
+$excluded_paths .= '|src/prop/(bv)?minisat/utils/.*';
+$excluded_paths .= ')$';
# Years of copyright for the template. E.g., the string
# "1985, 1987, 1992, 1997, 2008" or "2006-2009" or whatever.
-my $years = '2009-2014';
+my $years = '2009-2018';
my $standard_template = <<EOF;
** This file is part of the CVC4 project.
- ** Copyright (c) $years New York University and The University of Iowa
- ** See the file COPYING in the top-level source directory for licensing
- ** information.\\endverbatim
+ ** Copyright (c) $years by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\\endverbatim
EOF
## end config ##
while($#searchdirs >= 0) {
my $dir = shift @searchdirs;
+ $dir =~ s,\/$,,; # remove trailing slash from directory
my $mode = (stat($dir))[2] || warn "file or directory \`$dir' does not exist!";
my $is_directory = S_ISDIR($mode);
if($is_directory) {
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;
+ my $authors = <$AUTHOR>; chomp $authors;
close $AUTHOR;
$_ = <$IN>;
- if(m,^(%{)?/\*(\*| )\*\*\*,) {
+ if(m,^(%\{)?/\*(\*| )\*\*\*,) {
print "updating\n";
if($file =~ /\.(y|yy|ypp|Y)$/) {
print $OUT "%{/******************* */\n";
print $OUT "/*! \\file $file\n";
}
print $OUT " ** \\verbatim\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 " ** Top contributors (to current version):\n";
+ print $OUT " ** $authors\n";
my $comment_stub = "";
while(my $line = <$IN>) {
- if($line =~ /\b[Cc]opyright\b/ && $line !~ /\bNew York University and The University of Iowa\b/) {
+ if($line =~ /\b[Cc]opyright\b/ && $line !~ /\bby the authors listed in the file AUTHORS\b/) {
# someone else holds this copyright
print $OUT $line;
}
print $OUT "/*! \\file $file\n";
}
print $OUT " ** \\verbatim\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 " ** Top contributors (to current version):\n";
+ print $OUT " ** $authors\n";
print $OUT $standard_template;
print $OUT " **\n";
print $OUT " ** \\brief [[ Add one-line brief description here ]]\n";
if($file =~ /\.(y|yy|ypp|Y)$/) {
while(my $line = <$IN>) {
chomp $line;
- if($line =~ '\s*%{(.*)') {
+ if($line =~ '\s*%\{(.*)') {
print $OUT "$1\n";
last;
}