update-copyright.py (Copyright.__init__): Add a regexp for "copyright = u'".

contrib/
	* update-copyright.py (Copyright.__init__): Add a regexp for
	"copyright = u'".
	(Copyright.update_copyright): Don't add a space before the year
	in that case.

From-SVN: r219692
This commit is contained in:
Richard Sandiford 2015-01-15 22:09:13 +00:00 committed by Richard Sandiford
parent 1d59990631
commit 8fced9b976
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2015-01-15 Richard Sandiford <richard.sandiford@arm.com>
* update-copyright.py (Copyright.__init__): Add a regexp for
"copyright = u'".
(Copyright.update_copyright): Don't add a space before the year
in that case.
2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
* gcc_update (files_and_dependencies): Update rules for new

View File

@ -183,6 +183,7 @@ class Copyright:
'|[Cc]opyright\s+%s'
'|[Cc]opyright\s+&copy;'
'|[Cc]opyright\s+@copyright{}'
'|copyright = u\''
'|@set\s+copyright[\w-]+)'
# 2: the years. Include the whitespace in the year, so that
@ -363,7 +364,8 @@ class Copyright:
return (False, orig_line, next_line)
line = (line[:match.start (2)]
+ ' ' + canon_form + self.separator
+ ('' if intro.startswith ('copyright = ') else ' ')
+ canon_form + self.separator
+ line[match.end (2):])
# Use the standard (C) form.