Skip to content

Commit 2f0aec7

Browse files
author
Ralph Castain
committed
Protect the embedded libraries when updating copyrights - we shouldn't be overwriting their copyrights with our own
bot:notest Signed-off-by: Ralph Castain <[email protected]>
1 parent 7762c21 commit 2f0aec7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

contrib/update-my-copyright.pl

Lines changed: 20 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,9 @@
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(pmi2x/pmix/ hwloc1113/hwloc/ libevent2022/libevent/);
72+
7073
# Override the defaults if some values are set in the environment
7174
$my_search_name = $ENV{OMPI_COPYRIGHT_SEARCH_NAME}
7275
if (defined($ENV{OMPI_COPYRIGHT_SEARCH_NAME}));
@@ -145,6 +148,22 @@ sub quiet_print {
145148

146149
# Examine each of the files and see if they need an updated copyright
147150
foreach my $f (@files) {
151+
152+
# ignore embedded copies of external codes as we shouldn't
153+
# be overwriting their copyrights - if someone actually
154+
# modified any of those files, they can manually update
155+
# the copyright
156+
my $ignore = 0;
157+
foreach my $p (@protected) {
158+
if (index($f, $p) != -1) {
159+
quiet_print "Ignoring protected file $f\n";
160+
$ignore = 1;
161+
last;
162+
}
163+
}
164+
if (1 == $ignore) {
165+
next;
166+
}
148167
quiet_print "Processing added/changed file: $f\n";
149168
open(FILE, $f) || die "Can't open file: $f";
150169

0 commit comments

Comments
 (0)