diff --git a/LICENCE.md b/LICENCE.md index f255ec0cb062..cae2c6930837 100644 --- a/LICENCE.md +++ b/LICENCE.md @@ -1,6 +1,6 @@ # TruffleRuby Licence -TruffleRuby is copyright (c) 2013-2022 Oracle and/or its affiliates, and is made +TruffleRuby is copyright (c) 2013-2023 Oracle and/or its affiliates, and is made available to you under the terms of any one of the following three licenses: * Eclipse Public License version 2.0, or diff --git a/README.md b/README.md index 2e33b668becd..d85caee71bed 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ For known vulnerabilities in Ruby, please refer to the [known-cves](doc/user/kno ## Licence -TruffleRuby is copyright (c) 2013-2022 Oracle and/or its affiliates, and is made +TruffleRuby is copyright (c) 2013-2023 Oracle and/or its affiliates, and is made available to you under the terms of any one of the following three licenses: * Eclipse Public License version 2.0, or diff --git a/doc/legal/legal.md b/doc/legal/legal.md index 2548630c8a61..29204d90d5e8 100644 --- a/doc/legal/legal.md +++ b/doc/legal/legal.md @@ -6,7 +6,7 @@ use TruffleRuby. ## TruffleRuby -TruffleRuby is copyright (c) 2013-2022 Oracle and/or its +TruffleRuby is copyright (c) 2013-2023 Oracle and/or its affiliates, and is made available to you under the terms of any one of the following three licenses: diff --git a/tool/update_copyright.rb b/tool/update_copyright.rb index 51fd042e64b9..38745680310b 100644 --- a/tool/update_copyright.rb +++ b/tool/update_copyright.rb @@ -40,9 +40,10 @@ '.h' => JAVA_COPYRIGHT, } -EXTENSIONS = %w[.java .rb .c .h] +EXTENSIONS = %w[.java .rb .c .h .md] -COPYRIGHT = /Copyright \(c\) (?\d{4})(?:, (?\d{4}))* Oracle\b/ +COPYRIGHT = /(?Copyright) \(c\) (?\d{4})(?:(?, )(?\d{4}))? Oracle\b/ +COPYRIGHT_MARKDOWN = /(?copyright) \(c\) (?\d{4})(?:(?-)(?\d{4}))? Oracle\b/ OTHER_COPYRIGHTS = [ /Copyright \(c\) \d{4}(?:-\d{4})?,? Evan Phoenix/, @@ -66,6 +67,9 @@ test/truffle tool/generate spec/truffle + LICENCE.md + README.md + doc/legal/legal.md ] + [__FILE__] excludes = %w[ @@ -115,24 +119,29 @@ } paths.each do |file| - header = File.read(file, 400) + ext = File.extname(file) + md = ext == '.md' + header = File.read(file, *(400 unless md)) - unless COPYRIGHT =~ header + copyright_regexp = md ? COPYRIGHT_MARKDOWN : COPYRIGHT + + unless copyright_regexp =~ header + next if md if OTHER_COPYRIGHTS.none? { |copyright| copyright =~ header } puts "Adding copyright in #{file}" - File.write(file, NEW_COPYRIGHT[File.extname(file)]+File.read(file)) + File.write(file, NEW_COPYRIGHT[ext]+File.read(file)) end next end - year1, year2 = $~[:year1], $~[:year2] + copyright, year1, sep, year2 = $~[:copyright], $~[:year1], $~[:sep], $~[:year2] year1 = Integer(year1) year2 = Integer(year2 || year1) if year > year2 contents = File.read(file) - years = "#{year1}, #{year}" - contents.sub!(COPYRIGHT, "Copyright (c) #{years} Oracle") + years = "#{year1}#{sep}#{year}" + contents.sub!(copyright_regexp, "#{copyright} (c) #{years} Oracle") File.write(file, contents) puts "Updated year in #{file}"