qapi: Generate up-to-date copyright notice
Each generator carries a copyright notice for the generator itself, and another one for the files it generates. Only the former have been updated along the way, the latter have not, and are all out of date. Fix by copying the generator's copyright notice to the generated files instead. Note that the fix doesn't copy the "Authors:" part; the generated files' outdated Authors list goes away without replacement. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180211093607.27351-4-armbru@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> [eblake: Flatten each 'blurb' to one line] Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
committed by
Eric Blake
parent
c263de3f41
commit
5ddeec83eb
@@ -1985,21 +1985,24 @@ def parse_command_line(extra_options='', extra_long_options=[]):
|
||||
#
|
||||
|
||||
|
||||
def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb):
|
||||
def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
|
||||
guard = guardname(prefix + h_file)
|
||||
c_file = output_dir + prefix + c_file
|
||||
h_file = output_dir + prefix + h_file
|
||||
copyright = '\n * '.join(re.findall(r'^Copyright .*', doc, re.MULTILINE))
|
||||
comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
|
||||
|
||||
/*
|
||||
%(blurb)s
|
||||
*
|
||||
* %(copyright)s
|
||||
*
|
||||
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
|
||||
* See the COPYING.LIB file in the top-level directory.
|
||||
*/
|
||||
|
||||
''',
|
||||
blurb=blurb.strip('\n'))
|
||||
blurb=blurb, copyright=copyright)
|
||||
|
||||
if output_dir:
|
||||
try:
|
||||
|
Reference in New Issue
Block a user