diff options
author | Tim King <taking@google.com> | 2016-04-03 19:38:06 -0700 |
---|---|---|
committer | Tim King <taking@google.com> | 2016-04-03 21:43:08 -0700 |
commit | 0f69a8ba2286bd5d9b807c10ad350705952e93d6 (patch) | |
tree | 1a9e851f4abefe56d7c4a0614c232edfd147fa9e /contrib | |
parent | 208a9989b53c61f7f1f0053e97600dd7e12f8aa5 (diff) |
Updating the copyright headers and scripts.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/get-authors | 20 | ||||
-rwxr-xr-x | contrib/update-copyright.pl | 24 |
2 files changed, 14 insertions, 30 deletions
diff --git a/contrib/get-authors b/contrib/get-authors index 2ff09b0ef..4c1bb0233 100755 --- a/contrib/get-authors +++ b/contrib/get-authors @@ -21,23 +21,11 @@ fi while [ $# -gt 0 ]; do f=$1 shift - original_author= - major_contributors= - minor_contributors= + contributors= total_lines=`wc -l "$f" | awk '{print$1}'` - original_author=`git log --use-mailmap --pretty="format:%aN <%aE>" "$f" | tail -1` - git blame --incremental "$f" | gawk '/^[0-9a-f]+ [0-9]+ [0-9]+ [0-9]+$/ {nl=$4;} /^summary .*copyright/ {nl=0} /^author / {$1=""; author=$0;} /^author-mail / {mail=$2} /^filename / {while(nl--) {print author,mail}}' | sed "s,Not Committed Yet <not.committed.yet>,$gituser," | sort | uniq -c | sort -n | + git blame --incremental "$f" | gawk '/^[0-9a-f]+ [0-9]+ [0-9]+ [0-9]+$/ {nl=$4;} /^summary .*copyright/ {nl=0} /^author / {$1=""; author=$0;} /^author-mail / {mail=$2} /^filename / {while(nl--) {print author,mail}}' | sed "s,Not Committed Yet <not.committed.yet>,$gituser," | sort | uniq -c | sort -nr | head -n 3 | ( while read lines author; do - pct=$((100*$lines/$total_lines)) - if [ "$author" != "$original_author" ]; then - if [ $pct -ge 10 ]; then - major_contributors="${major_contributors:+$major_contributors, }$author" - else - minor_contributors="${minor_contributors:+$minor_contributors, }$author" - fi - fi + contributors="${contributors:+$contributors, }$author" done; \ - echo "$original_author" - echo "${major_contributors:-none}" - echo "${minor_contributors:-none}" ) | eval "$strip_email" + echo "$contributors") | eval "$strip_email" done diff --git a/contrib/update-copyright.pl b/contrib/update-copyright.pl index 2a581698c..ba0b4313d 100755 --- a/contrib/update-copyright.pl +++ b/contrib/update-copyright.pl @@ -39,13 +39,14 @@ my $excluded_paths = '^(src/parser/antlr_input_imports.cpp|src/bindings/compat/. # 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-2016'; 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 ## @@ -135,9 +136,7 @@ sub handleFile { 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,^(%{)?/\*(\*| )\*\*\*,) { @@ -154,12 +153,11 @@ sub handleFile { 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; } @@ -191,9 +189,7 @@ $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 authors (to current version): $authors\n"; print $OUT $standard_template; print $OUT " **\n"; print $OUT " ** \\brief [[ Add one-line brief description here ]]\n"; |