3 Run this script to update all the copyright headers of files 4 that were changed this year. 8 // Copyright (c) 2009-2012 The Bitcoin Core developers 12 // Copyright (c) 2009-2015 The Bitcoin Core developers 18 year = time.gmtime()[0]
19 CMD_GIT_DATE =
'git log --format=@%%at -1 %s | date +"%%Y" -u -f -' 20 CMD_REGEX=
"perl -pi -e 's/(20\d\d)(?:-20\d\d)? The Bitcoin/$1-%s The Bitcoin/' %s" 21 REGEX_CURRENT= re.compile(
"%s The Bitcoin" % year)
22 CMD_LIST_FILES=
"find %s | grep %s" 24 FOLDERS = [
"./qa",
"./src"]
25 EXTENSIONS = [
".cpp",
".h",
".py"]
28 r = os.popen(CMD_GIT_DATE % file_path)
31 return l.replace(
"\n",
"")
35 for folder
in FOLDERS:
36 for extension
in EXTENSIONS:
37 for file_path
in os.popen(CMD_LIST_FILES % (folder, extension)):
38 file_path = os.getcwd() + file_path[1:-1]
39 if file_path.endswith(extension):
41 if str(year) == git_date:
43 if REGEX_CURRENT.search(open(file_path,
"r").read()) is None: 44 print n,
"Last git edit", git_date,
"-", file_path
45 os.popen(CMD_REGEX % (year,file_path))