2 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
9 # Add new copyright and delete old ones. Used as
10 # find . -name '*.[ch]' -type f -exec perl -i.bak util/copyright.pl '{}' ';'
11 # This does not do everything that's needed for the consolidation.
16 # Read a multi-line comments. If it matches a "fingerprint" of a legacy
17 # copyright block, then just delete it.
23 if ($lines[$#lines] !~ m@\*/@) {
27 $skipit = 1 if /Copyright remains Eric Young's/i;
28 $skipit = 1 if /Copyright.*The OpenSSL Project/i;
29 $skipit = 1 if /Written by.*for the OpenSSL Project/i;
33 # Look for a multi-line "written by" comment.
35 my $text = join('', @lines);
36 $skipit = 1 if $text =~ m/Written by.*for the OpenSSL Project/is;
39 print @lines unless $skipit;
43 # Look for leading copyright blocks and process (print/swallow) them.
47 # Look for special copyright EAY line at line one.
48 if ( /Copyright.*(199.)-.*Eric Young/ ) {
51 # Nope, use when it first existed in git.
52 $DATE=`git log '--pretty=format:%cI' $ARGV | tail -1`;
55 my $YEAR = $DATE ? $DATE : 1995;
56 my $SPAN = $YEAR == 2016 ? "2016" : "${YEAR}-2016";
59 * Copyright ${SPAN} The OpenSSL Project Authors. All Rights Reserved.
61 * Licensed under the OpenSSL license (the "License"). You may not use
62 * this file except in compliance with the License. You can obtain a copy
63 * in the file LICENSE in the source distribution or at
64 * https://www.openssl.org/source/license.html
71 last unless &check_comment($_);