mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-08 16:10:49 +00:00
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. Backports commit 5ddeec83eb0284b52bb3d496a49ba1657069ed45 from qemu
This commit is contained in:
parent
42f64cc962
commit
b03a71e1e4
|
@ -1,15 +1,16 @@
|
||||||
#
|
"""
|
||||||
# QAPI event generator
|
QAPI event generator
|
||||||
#
|
|
||||||
# Copyright (c) 2014 Wenchao Xia
|
Copyright (c) 2014 Wenchao Xia
|
||||||
# Copyright (c) 2015-2016 Red Hat Inc.
|
Copyright (c) 2015-2018 Red Hat Inc.
|
||||||
#
|
|
||||||
# Authors:
|
Authors:
|
||||||
# Wenchao Xia <wenchaoqemu@gmail.com>
|
Wenchao Xia <wenchaoqemu@gmail.com>
|
||||||
# Markus Armbruster <armbru@redhat.com>
|
Markus Armbruster <armbru@redhat.com>
|
||||||
#
|
|
||||||
# This work is licensed under the terms of the GNU GPL, version 2.
|
This work is licensed under the terms of the GNU GPL, version 2.
|
||||||
# See the COPYING file in the top-level directory.
|
See the COPYING file in the top-level directory.
|
||||||
|
"""
|
||||||
|
|
||||||
from qapi import *
|
from qapi import *
|
||||||
|
|
||||||
|
@ -170,19 +171,12 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
|
||||||
|
|
||||||
(input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
|
(input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
|
||||||
|
|
||||||
blurb = '''
|
blurb = ' * Schema-defined QAPI/QMP events'
|
||||||
* Schema-defined QAPI/QMP events
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014 Wenchao Xia
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Wenchao Xia <wenchaoqemu@gmail.com>
|
|
||||||
*/
|
|
||||||
'''
|
|
||||||
|
|
||||||
(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
|
(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
|
||||||
'qapi-event.c', 'qapi-event.h',
|
'qapi-event.c', 'qapi-event.h',
|
||||||
blurb)
|
blurb, __doc__)
|
||||||
|
|
||||||
fdef.write(mcgen('''
|
fdef.write(mcgen('''
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.h"
|
||||||
#include "%(prefix)sqapi-event.h"
|
#include "%(prefix)sqapi-event.h"
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
#
|
"""
|
||||||
# QAPI types generator
|
QAPI types generator
|
||||||
#
|
|
||||||
# Copyright IBM, Corp. 2011
|
Copyright IBM, Corp. 2011
|
||||||
# Copyright (c) 2013-2016 Red Hat Inc.
|
Copyright (c) 2013-2018 Red Hat Inc.
|
||||||
#
|
|
||||||
# Authors:
|
Authors:
|
||||||
# Anthony Liguori <aliguori@us.ibm.com>
|
Anthony Liguori <aliguori@us.ibm.com>
|
||||||
# Markus Armbruster <armbru@redhat.com>
|
Michael Roth <mdroth@linux.vnet.ibm.com>
|
||||||
#
|
Markus Armbruster <armbru@redhat.com>
|
||||||
# This work is licensed under the terms of the GNU GPL, version 2.
|
|
||||||
|
This work is licensed under the terms of the GNU GPL, version 2.
|
||||||
# See the COPYING file in the top-level directory.
|
# See the COPYING file in the top-level directory.
|
||||||
|
"""
|
||||||
|
|
||||||
from qapi import *
|
from qapi import *
|
||||||
|
|
||||||
|
@ -250,19 +252,11 @@ for o, a in opts:
|
||||||
if o in ('-b', '--builtins'):
|
if o in ('-b', '--builtins'):
|
||||||
do_builtins = True
|
do_builtins = True
|
||||||
|
|
||||||
blurb = '''
|
blurb = ' * Schema-defined QAPI types'
|
||||||
* Schema-defined QAPI types
|
|
||||||
*
|
|
||||||
* Copyright IBM, Corp. 2011
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Anthony Liguori <aliguori@us.ibm.com>
|
|
||||||
* Michael Roth <mdroth@linux.vnet.ibm.com>
|
|
||||||
'''
|
|
||||||
|
|
||||||
(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
|
(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
|
||||||
'qapi-types.c', 'qapi-types.h',
|
'qapi-types.c', 'qapi-types.h',
|
||||||
blurb)
|
blurb, __doc__)
|
||||||
|
|
||||||
fdef.write(mcgen('''
|
fdef.write(mcgen('''
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#
|
"""
|
||||||
# QAPI visitor generator
|
QAPI visitor generator
|
||||||
#
|
|
||||||
# Copyright IBM, Corp. 2011
|
Copyright IBM, Corp. 2011
|
||||||
# Copyright (C) 2014-2016 Red Hat, Inc.
|
Copyright (C) 2014-2018 Red Hat, Inc.
|
||||||
#
|
|
||||||
# Authors:
|
Authors:
|
||||||
# Anthony Liguori <aliguori@us.ibm.com>
|
Anthony Liguori <aliguori@us.ibm.com>
|
||||||
# Michael Roth <mdroth@linux.vnet.ibm.com>
|
Michael Roth <mdroth@linux.vnet.ibm.com>
|
||||||
# Markus Armbruster <armbru@redhat.com>
|
Markus Armbruster <armbru@redhat.com>
|
||||||
#
|
|
||||||
# This work is licensed under the terms of the GNU GPL, version 2.
|
This work is licensed under the terms of the GNU GPL, version 2.
|
||||||
# See the COPYING file in the top-level directory.
|
See the COPYING file in the top-level directory.
|
||||||
|
"""
|
||||||
|
|
||||||
from qapi import *
|
from qapi import *
|
||||||
|
|
||||||
|
@ -334,18 +335,11 @@ for o, a in opts:
|
||||||
if o in ('-b', '--builtins'):
|
if o in ('-b', '--builtins'):
|
||||||
do_builtins = True
|
do_builtins = True
|
||||||
|
|
||||||
blurb = '''
|
blurb = ' * Schema-defined QAPI visitors'
|
||||||
* Schema-defined QAPI visitors
|
|
||||||
*
|
|
||||||
* Copyright IBM, Corp. 2011
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Anthony Liguori <aliguori@us.ibm.com>
|
|
||||||
'''
|
|
||||||
|
|
||||||
(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
|
(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
|
||||||
'qapi-visit.c', 'qapi-visit.h',
|
'qapi-visit.c', 'qapi-visit.h',
|
||||||
blurb)
|
blurb, __doc__)
|
||||||
|
|
||||||
fdef.write(mcgen('''
|
fdef.write(mcgen('''
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
|
|
@ -1990,21 +1990,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)
|
guard = guardname(prefix + h_file)
|
||||||
c_file = output_dir + prefix + c_file
|
c_file = output_dir + prefix + c_file
|
||||||
h_file = output_dir + prefix + h_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 */
|
comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
%(blurb)s
|
%(blurb)s
|
||||||
|
*
|
||||||
|
* %(copyright)s
|
||||||
*
|
*
|
||||||
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
|
* 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.
|
* See the COPYING.LIB file in the top-level directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
''',
|
''',
|
||||||
blurb=blurb.strip('\n'))
|
blurb=blurb, copyright=copyright)
|
||||||
|
|
||||||
if output_dir:
|
if output_dir:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue