diff --git a/contrib/devtools/copyright_header.py b/contrib/devtools/copyright_header.py index 9f35c378bf..41a334380c 100755 --- a/contrib/devtools/copyright_header.py +++ b/contrib/devtools/copyright_header.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers +# Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -105,6 +106,8 @@ def compile_copyright_regex(copyright_style, year_style, name): "Jan-Klaas Kollhof\n", "Sam Rushing\n", "ArtForz -- public domain half-a-node\n", + "Amaury SÉCHET\n", + "Jeremy Rubin\n", ] DOMINANT_STYLE_COMPILED = {} @@ -340,7 +343,7 @@ def write_file_lines(filename, file_lines): COPYRIGHT = 'Copyright \(c\)' YEAR = "20[0-9][0-9]" YEAR_RANGE = '(%s)(-%s)?' % (YEAR, YEAR) -HOLDER = 'The Bitcoin Core developers' +HOLDER = 'The Bitcoin developers' UPDATEABLE_LINE_COMPILED = re.compile(' '.join([COPYRIGHT, YEAR_RANGE, HOLDER])) def get_updatable_copyright_line(file_lines): @@ -408,24 +411,24 @@ def exec_update_header_year(base_directory): ################################################################################ UPDATE_USAGE = """ -Updates all the copyright headers of "The Bitcoin Core developers" which were +Updates all the copyright headers of "The Bitcoin developers" which were changed in a year more recent than is listed. For example: -// Copyright (c) - The Bitcoin Core developers +// Copyright (c) - The Bitcoin developers will be updated to: -// Copyright (c) - The Bitcoin Core developers +// Copyright (c) - The Bitcoin developers where is obtained from the 'git log' history. This subcommand also handles copyright headers that have only a single year. In those cases: -// Copyright (c) The Bitcoin Core developers +// Copyright (c) The Bitcoin developers will be updated to: -// Copyright (c) - The Bitcoin Core developers +// Copyright (c) - The Bitcoin developers where the update is appropriate. @@ -458,7 +461,7 @@ def get_header_lines(header, start_year, end_year): return [line + '\n' for line in lines] CPP_HEADER = ''' -// Copyright (c) %s The Bitcoin Core developers +// Copyright (c) %s The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' @@ -467,7 +470,7 @@ def get_cpp_header_lines_to_insert(start_year, end_year): return reversed(get_header_lines(CPP_HEADER, start_year, end_year)) PYTHON_HEADER = ''' -# Copyright (c) %s The Bitcoin Core developers +# Copyright (c) %s The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' @@ -487,7 +490,7 @@ def get_git_change_year_range(filename): # check for existing core copyright ################################################################################ -def file_already_has_core_copyright(file_lines): +def file_already_has_bitcoin_copyright(file_lines): index, _ = get_updatable_copyright_line(file_lines) return index != None @@ -520,8 +523,8 @@ def insert_cpp_header(filename, file_lines, start_year, end_year): def exec_insert_header(filename, style): file_lines = read_file_lines(filename) - if file_already_has_core_copyright(file_lines): - sys.exit('*** %s already has a copyright by The Bitcoin Core developers' + if file_already_has_bitcoin_copyright(file_lines): + sys.exit('*** %s already has a copyright by The Bitcoin developers' % (filename)) start_year, end_year = get_git_change_year_range(filename) if style == 'python': @@ -534,7 +537,7 @@ def exec_insert_header(filename, style): ################################################################################ INSERT_USAGE = """ -Inserts a copyright header for "The Bitcoin Core developers" at the top of the +Inserts a copyright header for "The Bitcoin developers" at the top of the file in either Python or C++ style as determined by the file extension. If the file is a Python file and it has a '#!' starting the first line, the header is inserted in the line below it. @@ -548,7 +551,7 @@ def exec_insert_header(filename, style): "" -If the file already has a copyright for "The Bitcoin Core developers", the +If the file already has a copyright for "The Bitcoin developers", the script will exit. Usage: @@ -581,7 +584,7 @@ def insert_cmd(argv): USAGE = """ copyright_header.py - utilities for managing copyright headers of 'The Bitcoin -Core developers' in repository source files. +developers' in repository source files. Usage: $ ./copyright_header