All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, marcandre.lureau@redhat.com,
	eblake@redhat.com
Subject: [Qemu-devel] [PATCH v2 03/29] qapi: Generate up-to-date copyright notice
Date: Sun, 11 Feb 2018 10:35:41 +0100	[thread overview]
Message-ID: <20180211093607.27351-4-armbru@redhat.com> (raw)
In-Reply-To: <20180211093607.27351-1-armbru@redhat.com>

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>
---
 scripts/qapi-commands.py   | 34 +++++++++++++++-------------------
 scripts/qapi-event.py      | 32 ++++++++++++++------------------
 scripts/qapi-introspect.py | 25 ++++++++++++-------------
 scripts/qapi-types.py      | 32 ++++++++++++++------------------
 scripts/qapi-visit.py      | 34 +++++++++++++++-------------------
 scripts/qapi.py            |  7 +++++--
 6 files changed, 75 insertions(+), 89 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 8e8da7c796..84a980d882 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -1,16 +1,17 @@
-#
-# QAPI command marshaller generator
-#
-# Copyright IBM, Corp. 2011
-# Copyright (C) 2014-2016 Red Hat, Inc.
-#
-# Authors:
-#  Anthony Liguori <aliguori@us.ibm.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.
-# See the COPYING file in the top-level directory.
+"""
+QAPI command marshaller generator
+
+Copyright IBM, Corp. 2011
+Copyright (C) 2014-2018 Red Hat, Inc.
+
+Authors:
+ Anthony Liguori <aliguori@us.ibm.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.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -257,16 +258,11 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
 
 blurb = '''
  * Schema-defined QAPI/QMP commands
- *
- * Copyright IBM, Corp. 2011
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qmp-marshal.c', 'qmp-commands.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 2b7d720c08..0a098803e2 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -1,15 +1,16 @@
-#
-# QAPI event generator
-#
-# Copyright (c) 2014 Wenchao Xia
-# Copyright (c) 2015-2016 Red Hat Inc.
-#
-# Authors:
-#  Wenchao Xia <wenchaoqemu@gmail.com>
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
-# See the COPYING file in the top-level directory.
+"""
+QAPI event generator
+
+Copyright (c) 2014 Wenchao Xia
+Copyright (c) 2015-2018 Red Hat Inc.
+
+Authors:
+ Wenchao Xia <wenchaoqemu@gmail.com>
+ Markus Armbruster <armbru@redhat.com>
+
+This work is licensed under the terms of the GNU GPL, version 2.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -173,16 +174,11 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
 
 blurb = '''
  * 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,
                             'qapi-event.c', 'qapi-event.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
index 83da2bdb94..bd9253a172 100644
--- a/scripts/qapi-introspect.py
+++ b/scripts/qapi-introspect.py
@@ -1,13 +1,14 @@
-#
-# QAPI introspection generator
-#
-# Copyright (C) 2015-2016 Red Hat, Inc.
-#
-# Authors:
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
-# See the COPYING file in the top-level directory.
+"""
+QAPI introspection generator
+
+Copyright (C) 2015-2018 Red Hat, Inc.
+
+Authors:
+ Markus Armbruster <armbru@redhat.com>
+
+This work is licensed under the terms of the GNU GPL, version 2.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -178,13 +179,11 @@ for o, a in opts:
 
 blurb = '''
  * QAPI/QMP schema introspection
- *
- * Copyright (C) 2015 Red Hat, Inc.
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qmp-introspect.c', 'qmp-introspect.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 86afc57f92..1103dbda2d 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -1,15 +1,17 @@
-#
-# QAPI types generator
-#
-# Copyright IBM, Corp. 2011
-# Copyright (c) 2013-2016 Red Hat Inc.
-#
-# Authors:
-#  Anthony Liguori <aliguori@us.ibm.com>
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
+"""
+QAPI types generator
+
+Copyright IBM, Corp. 2011
+Copyright (c) 2013-2018 Red Hat Inc.
+
+Authors:
+ Anthony Liguori <aliguori@us.ibm.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.
 # See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -252,17 +254,11 @@ for o, a in opts:
 
 blurb = '''
  * 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,
                             'qapi-types.c', 'qapi-types.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 0a367072fb..e56b3c1256 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -1,16 +1,17 @@
-#
-# QAPI visitor generator
-#
-# Copyright IBM, Corp. 2011
-# Copyright (C) 2014-2016 Red Hat, Inc.
-#
-# Authors:
-#  Anthony Liguori <aliguori@us.ibm.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.
-# See the COPYING file in the top-level directory.
+"""
+QAPI visitor generator
+
+Copyright IBM, Corp. 2011
+Copyright (C) 2014-2018 Red Hat, Inc.
+
+Authors:
+ Anthony Liguori <aliguori@us.ibm.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.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -336,16 +337,11 @@ for o, a in opts:
 
 blurb = '''
  * 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,
                             'qapi-visit.c', 'qapi-visit.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 2e5a1ce6a8..26c45cee34 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -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.strip('\n'), copyright=copyright)
 
     if output_dir:
         try:
-- 
2.13.6

  parent reply	other threads:[~2018-02-11  9:36 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11  9:35 [Qemu-devel] [PATCH v2 00/29] Modularize generated QAPI code Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 01/29] Include qapi/qmp/qerror.h exactly where needed Markus Armbruster
2018-02-12 16:55   ` Eric Blake
2018-02-13 15:24   ` Marc-Andre Lureau
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 02/29] qapi: Streamline boilerplate comment generation Markus Armbruster
2018-02-11  9:35 ` Markus Armbruster [this message]
2018-02-12 19:40   ` [Qemu-devel] [PATCH v2 03/29] qapi: Generate up-to-date copyright notice Eric Blake
2018-02-16 22:53   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 04/29] qapi: Rename variable holding the QAPISchemaGenFOOVisitor Markus Armbruster
2018-02-12 16:59   ` Eric Blake
2018-02-13 15:24   ` Marc-Andre Lureau
2018-02-16 22:56   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 05/29] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc Markus Armbruster
2018-02-17  0:59   ` Michael Roth
2018-02-23 17:18     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 06/29] qapi: Reduce use of global variables in generators some Markus Armbruster
2018-02-17  1:22   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 07/29] qapi: Turn generators into modules Markus Armbruster
2018-02-17  1:29   ` Michael Roth
2018-02-27 15:53   ` Eric Blake
2018-02-27 16:01     ` Daniel P. Berrangé
2018-04-13 12:49       ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 08/29] qapi-gen: New common driver for code and doc generators Markus Armbruster
2018-02-12 19:42   ` Eric Blake
2018-02-23 17:20     ` Markus Armbruster
2018-02-26 20:02       ` Eric Blake
2018-02-18 22:16   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 09/29] qapi-gen: Convert from getopt to argparse Markus Armbruster
2018-02-12 19:44   ` Eric Blake
2018-02-13 15:24   ` Marc-Andre Lureau
2018-02-18 22:31   ` Michael Roth
2018-02-23 17:21     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 10/29] qapi: Touch generated files only when they change Markus Armbruster
2018-02-12 19:48   ` Eric Blake
2018-02-13 15:22     ` Marc-Andre Lureau
2018-02-23 17:22       ` Markus Armbruster
2018-02-18 22:43   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 11/29] qapi: Improve include file name reporting in error messages Markus Armbruster
2018-02-18 23:11   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 12/29] qapi/common: Eliminate QAPISchema.exprs Markus Armbruster
2018-02-18 23:13   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 13/29] qapi: Lift error reporting from QAPISchema.__init__() to callers Markus Armbruster
2018-02-12 19:52   ` Eric Blake
2018-02-18 23:17   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 14/29] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__() Markus Armbruster
2018-02-12 19:56   ` Eric Blake
2018-02-18 23:32   ` Michael Roth
2018-02-23 17:29     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 15/29] qapi: Record 'include' directives in parse tree Markus Armbruster
2018-02-12 20:03   ` Eric Blake
2018-02-18 23:57   ` Michael Roth
2018-02-23 17:31     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 16/29] qapi: Generate in source order Markus Armbruster
2018-02-12 20:06   ` Eric Blake
2018-02-19  0:01   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 17/29] qapi: Record 'include' directives in intermediate representation Markus Armbruster
2018-02-12 20:34   ` Eric Blake
2018-02-23 17:33     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 18/29] qapi: Rename generated qmp-marshal.c to qmp-commands.c Markus Armbruster
2018-02-12 20:56   ` Eric Blake
2018-02-13 15:25   ` Marc-Andre Lureau
2018-02-19  0:21   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 19/29] qapi: Make code-generating visitors use QAPIGen more Markus Armbruster
2018-02-12 21:06   ` Eric Blake
2018-02-13 15:25   ` Marc-Andre Lureau
2018-02-19 15:52   ` Michael Roth
2018-02-23 17:35     ` Markus Armbruster
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 20/29] qapi/types qapi/visit: Generate built-in stuff into separate files Markus Armbruster
2018-02-12 21:44   ` Eric Blake
2018-02-23 17:36     ` Markus Armbruster
2018-02-13 15:25   ` Marc-Andre Lureau
2018-02-19 19:30   ` Michael Roth
2018-02-11  9:35 ` [Qemu-devel] [PATCH v2 21/29] qapi/common: Fix guardname() for funny filenames Markus Armbruster
2018-02-19 18:18   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 22/29] qapi: Generate separate .h, .c for each module Markus Armbruster
2018-02-12 22:06   ` Eric Blake
2018-02-23 17:41     ` Markus Armbruster
2018-02-26 22:39       ` Eric Blake
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 23/29] Include less of the generated modular QAPI headers Markus Armbruster
2018-02-12 22:13   ` Eric Blake
2018-02-23 17:47     ` Markus Armbruster
2018-02-13 15:54   ` Marc-Andre Lureau
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 24/29] qapi: Empty out qapi-schema.json Markus Armbruster
2018-02-12 22:26   ` Eric Blake
2018-02-23 17:50     ` Markus Armbruster
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 25/29] docs/devel/writing-qmp-commands: Update for modular QAPI Markus Armbruster
2018-02-12 22:27   ` Eric Blake
2018-02-13 16:00   ` Marc-Andre Lureau
2018-02-19 19:33   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 26/29] docs: Correct outdated information on QAPI Markus Armbruster
2018-02-12 22:29   ` Eric Blake
2018-02-13 16:03   ` Marc-Andre Lureau
2018-02-19 19:35   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 27/29] qapi: Move qapi-schema.json to qapi/, rename generated files Markus Armbruster
2018-02-12 22:36   ` Eric Blake
2018-02-23 17:51     ` Markus Armbruster
2018-02-13 16:08   ` Marc-Andre Lureau
2018-02-19 19:37   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 28/29] Fix up dangling references to qmp-commands.* in comment and doc Markus Armbruster
2018-02-12 22:47   ` Eric Blake
2018-02-13 16:12   ` Marc-Andre Lureau
2018-02-19 19:38   ` Michael Roth
2018-02-11  9:36 ` [Qemu-devel] [PATCH v2 29/29] qapi: Don't create useless directory qapi-generated Markus Armbruster
2018-02-12 22:48   ` Eric Blake
2018-02-13 16:15   ` Marc-Andre Lureau
2018-02-19 19:38   ` Michael Roth
2018-02-11 10:16 ` [Qemu-devel] [PATCH v2 00/29] Modularize generated QAPI code no-reply
2018-02-26 22:57 ` [Qemu-devel] [PATCH v2 23.5/29] watchdog: Consolidate QAPI into single file Eric Blake
2018-02-26 23:10   ` Eric Blake
2018-02-27 14:19 ` [Qemu-devel] [PATCH v2 00/29] Modularize generated QAPI code Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180211093607.27351-4-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.