Skip to content

Commit 63e09d7

Browse files
committed
adding --manual-list="file" to update-my-copyright.pl
Along with using git status and related commands to find a list of modified files to update the copyright on, this adds the option of using a manually created list from a file (one filename per line). Signed-off-by: Mark Allen <[email protected]>
1 parent 246a270 commit 63e09d7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contrib/update-my-copyright.pl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
44
# Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
5+
# Copyright (c) 2017 IBM Corporation. All rights reserved.
56
# $COPYRIGHT$
67
#
78

@@ -66,6 +67,7 @@
6667
# Defaults
6768
my $my_search_name = "Cisco";
6869
my $my_formal_name = "Cisco Systems, Inc. All rights reserved.";
70+
my $my_manual_list = "";
6971

7072
# Protected directories
7173
my @protected = qw(
@@ -80,13 +82,16 @@
8082
if (defined($ENV{OMPI_COPYRIGHT_SEARCH_NAME}));
8183
$my_formal_name = $ENV{OMPI_COPYRIGHT_FORMAL_NAME}
8284
if (defined($ENV{OMPI_COPYRIGHT_FORMAL_NAME}));
85+
$my_manual_list = $ENV{OMPI_COPYRIGHT_MANUAL_LIST}
86+
if (defined($ENV{OMPI_COPYRIGHT_MANUAL_LIST}));
8387

8488
GetOptions(
8589
"help" => \$HELP,
8690
"quiet" => \$QUIET,
8791
"check-only" => \$CHECK_ONLY,
8892
"search-name=s" => \$my_search_name,
8993
"formal-name=s" => \$my_formal_name,
94+
"manual-list=s" => \$my_manual_list,
9095
) or die "unable to parse options, stopped";
9196

9297
if ($HELP) {
@@ -98,6 +103,7 @@
98103
--check-only exit(111) if there are files with copyrights to edit
99104
--search-name=NAME Set search name to NAME
100105
--formal-same=NAME Set formal name to NAME
106+
--manual-list=FNAME Use specified file as list of files to mod copyright
101107
EOT
102108
exit(0);
103109
}
@@ -143,6 +149,8 @@ sub quiet_print {
143149
if (-d "$top/.hg");
144150
$vcs = "svn"
145151
if (-d "$top/.svn");
152+
$vcs = "manual"
153+
if ("$my_manual_list" ne "");
146154

147155
my @files = find_modified_files($vcs);
148156

@@ -363,6 +371,9 @@ sub find_modified_files {
363371
}
364372
close(CMD);
365373
}
374+
elsif ($vcs eq "manual") {
375+
@files = split(/\n/, `cat $my_manual_list`);
376+
}
366377
else {
367378
die "unknown VCS '$vcs', stopped";
368379
}

0 commit comments

Comments
 (0)