From 2f0aec709aa38a8eeef1f47f4f4d73c99c824f30 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 13 Feb 2017 21:01:23 -0800 Subject: [PATCH] Protect the embedded libraries when updating copyrights - we shouldn't be overwriting their copyrights with our own bot:notest Signed-off-by: Ralph Castain --- contrib/update-my-copyright.pl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/contrib/update-my-copyright.pl b/contrib/update-my-copyright.pl index 35ece569f4..bed0f0a971 100755 --- a/contrib/update-my-copyright.pl +++ b/contrib/update-my-copyright.pl @@ -1,7 +1,7 @@ #!/usr/bin/env perl # # Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2016 Intel, Inc. All rights reserved. +# Copyright (c) 2016-2017 Intel, Inc. All rights reserved. # $COPYRIGHT$ # @@ -67,6 +67,9 @@ my $HELP = 0; my $my_search_name = "Cisco"; my $my_formal_name = "Cisco Systems, Inc. All rights reserved."; +# Protected directories +my @protected = qw(pmi2x/pmix/ hwloc1113/hwloc/ libevent2022/libevent/); + # Override the defaults if some values are set in the environment $my_search_name = $ENV{OMPI_COPYRIGHT_SEARCH_NAME} if (defined($ENV{OMPI_COPYRIGHT_SEARCH_NAME})); @@ -145,6 +148,22 @@ if ($#files < 0) { # Examine each of the files and see if they need an updated copyright foreach my $f (@files) { + + # ignore embedded copies of external codes as we shouldn't + # be overwriting their copyrights - if someone actually + # modified any of those files, they can manually update + # the copyright + my $ignore = 0; + foreach my $p (@protected) { + if (index($f, $p) != -1) { + quiet_print "Ignoring protected file $f\n"; + $ignore = 1; + last; + } + } + if (1 == $ignore) { + next; + } quiet_print "Processing added/changed file: $f\n"; open(FILE, $f) || die "Can't open file: $f";