|
1 | 1 | #!/usr/bin/env perl
|
2 | 2 | #
|
3 | 3 | # Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
|
4 |
| -# Copyright (c) 2016 Intel, Inc. All rights reserved. |
| 4 | +# Copyright (c) 2016-2017 Intel, Inc. All rights reserved. |
5 | 5 | # $COPYRIGHT$
|
6 | 6 | #
|
7 | 7 |
|
|
67 | 67 | my $my_search_name = "Cisco";
|
68 | 68 | my $my_formal_name = "Cisco Systems, Inc. All rights reserved.";
|
69 | 69 |
|
| 70 | +# Protected directories |
| 71 | +my @protected = qw( |
| 72 | + opal\\/mca\\/pmi\\/pmix.+?\\/pmix\\/ |
| 73 | + opal\\/mca\\/hwloc\\/hwloc.+?\\/hwloc\\/ |
| 74 | + opal\\/mca\\/libevent\\/libevent.+?\\/libevent\\/ |
| 75 | + contrib\\/update-my-copyright.pl |
| 76 | +); |
| 77 | + |
70 | 78 | # Override the defaults if some values are set in the environment
|
71 | 79 | $my_search_name = $ENV{OMPI_COPYRIGHT_SEARCH_NAME}
|
72 | 80 | if (defined($ENV{OMPI_COPYRIGHT_SEARCH_NAME}));
|
@@ -145,6 +153,22 @@ sub quiet_print {
|
145 | 153 |
|
146 | 154 | # Examine each of the files and see if they need an updated copyright
|
147 | 155 | foreach my $f (@files) {
|
| 156 | + |
| 157 | + # ignore embedded copies of external codes as we shouldn't |
| 158 | + # be overwriting their copyrights - if someone actually |
| 159 | + # modified any of those files, they can manually update |
| 160 | + # the copyright |
| 161 | + my $ignore = 0; |
| 162 | + foreach my $p (@protected) { |
| 163 | + if (eval("\$f =~ /$p/")) { |
| 164 | + quiet_print "Ignoring protected file $f\n"; |
| 165 | + $ignore = 1; |
| 166 | + last; |
| 167 | + } |
| 168 | + } |
| 169 | + if (1 == $ignore) { |
| 170 | + next; |
| 171 | + } |
148 | 172 | quiet_print "Processing added/changed file: $f\n";
|
149 | 173 | open(FILE, $f) || die "Can't open file: $f";
|
150 | 174 |
|
|
0 commit comments