Skip to content

Commit 26c366a

Browse files
author
Ralph Castain
authored
Merge pull request #2964 from rhc54/topic/copyright
Protect the embedded libraries when updating copyrights
2 parents 7762c21 + 665850e commit 26c366a

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

contrib/update-my-copyright.pl

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env perl
22
#
33
# 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.
55
# $COPYRIGHT$
66
#
77

@@ -67,6 +67,14 @@
6767
my $my_search_name = "Cisco";
6868
my $my_formal_name = "Cisco Systems, Inc. All rights reserved.";
6969

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+
7078
# Override the defaults if some values are set in the environment
7179
$my_search_name = $ENV{OMPI_COPYRIGHT_SEARCH_NAME}
7280
if (defined($ENV{OMPI_COPYRIGHT_SEARCH_NAME}));
@@ -145,6 +153,22 @@ sub quiet_print {
145153

146154
# Examine each of the files and see if they need an updated copyright
147155
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+
}
148172
quiet_print "Processing added/changed file: $f\n";
149173
open(FILE, $f) || die "Can't open file: $f";
150174

0 commit comments

Comments
 (0)