[libvirt] [PATCH] maint: make Red Hat copyright notices consistent

Spell out 'Red Hat, Inc.': git grep -i 'Copyright.*Red Hat' | grep -v Inc Include (C) consistently: git grep -i 'Copyright [^(].*Red Hat' * src/lxc/lxc_container.c: Update copyright formatting. * src/node_device/node_device_udev.c: Likewise. * src/node_device/node_device_udev.h: Likewise. * src/xen/xend_internal.h: Likewise. * src/xen/xm_internal.c: Likewise. * src/xen/xm_internal.h: Likewise. * tests/xmconfigtest.c: Likewise. * tests/object-locking.ml: Likewise. --- src/lxc/lxc_container.c | 4 ++-- src/node_device/node_device_udev.c | 2 +- src/node_device/node_device_udev.h | 2 +- src/xen/xend_internal.h | 2 +- src/xen/xm_internal.c | 2 +- src/xen/xm_internal.h | 2 +- tests/object-locking.ml | 2 +- tests/xmconfigtest.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 68b4656..706c796 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -1,6 +1,6 @@ /* - * Copyright IBM Corp. 2008 - * Copyright Red Hat 2008-2009 + * Copyright (C) 2008-2010 Red Hat, Inc. + * Copyright (C) 2008 IBM Corp. * * lxc_container.c: file description * diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 11e27e0..e3114fa 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1,7 +1,7 @@ /* * node_device_udev.c: node device enumeration - libudev implementation * - * Copyright (C) 2009-2010 Red Hat + * Copyright (C) 2009-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/node_device/node_device_udev.h b/src/node_device/node_device_udev.h index 8367494..cdaa142 100644 --- a/src/node_device/node_device_udev.h +++ b/src/node_device/node_device_udev.h @@ -1,7 +1,7 @@ /* * node_device_udev.h: node device enumeration - libudev implementation * - * Copyright (C) 2009 Red Hat + * Copyright (C) 2009-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/xen/xend_internal.h b/src/xen/xend_internal.h index 483253f..028a293 100644 --- a/src/xen/xend_internal.h +++ b/src/xen/xend_internal.h @@ -1,12 +1,12 @@ /* * xend_internal.h * + * Copyright (C) 2006-2008, 2010 Red Hat, Inc. * Copyright (C) 2005,2006 * * Anthony Liguori <aliguori@us.ibm.com> * Daniel Veillard <veillard@redhat.com> * - * Copyright 2006-2008 Red Hat * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file COPYING in the main directory of this archive diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c index 3d4624d..74bf0b6 100644 --- a/src/xen/xm_internal.c +++ b/src/xen/xm_internal.c @@ -1,7 +1,7 @@ /* * xm_internal.h: helper routines for dealing with inactive domains * - * Copyright (C) 2006-2007, 2009, 2010 Red Hat + * Copyright (C) 2006-2007, 2009-2010 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * This library is free software; you can redistribute it and/or diff --git a/src/xen/xm_internal.h b/src/xen/xm_internal.h index 37132ef..3ad3456 100644 --- a/src/xen/xm_internal.h +++ b/src/xen/xm_internal.h @@ -1,7 +1,7 @@ /* * xm_internal.h: helper routines for dealing with inactive domains * - * Copyright (C) 2006-2007 Red Hat + * Copyright (C) 2006-2007, 2010 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * This library is free software; you can redistribute it and/or diff --git a/tests/object-locking.ml b/tests/object-locking.ml index a4cd77d..1fddd51 100644 --- a/tests/object-locking.ml +++ b/tests/object-locking.ml @@ -1,7 +1,7 @@ (* * Analyse libvirt driver API methods for mutex locking mistakes * - * Copyright 2008-2009 Red Hat, Inc + * Copyright (C) 2008-2010 Red Hat, Inc * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index acb6d18..a199c72 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -1,7 +1,7 @@ /* * xmconfigtest.c: Test backend for xm_internal config file handling * - * Copyright (C) 2007 Red Hat + * Copyright (C) 2007, 2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public -- 1.6.6.1

Eric Blake wrote:
Spell out 'Red Hat, Inc.': git grep -i 'Copyright.*Red Hat' | grep -v Inc
Include (C) consistently: git grep -i 'Copyright [^(].*Red Hat'
* src/lxc/lxc_container.c: Update copyright formatting. * src/node_device/node_device_udev.c: Likewise. * src/node_device/node_device_udev.h: Likewise. * src/xen/xend_internal.h: Likewise. * src/xen/xm_internal.c: Likewise. * src/xen/xm_internal.h: Likewise. * tests/xmconfigtest.c: Likewise. * tests/object-locking.ml: Likewise.
ACK. Mechanical, comment-only change. One suggestion: consistency-adding changes are great, but they're worth much more when accompanied by syntax-check style rules that ensure future consistency, too. On that note, after your changes, there are only two violations: $ git grep -i 'Copyright [^(].*Red Hat' tools/virt-pki-validate.in:Copyright 2006-2009 by Red Hat, Inc tools/virt-xml-validate.in:Copyright 2009 by Red Hat, Inc So I'll fold in fixes: diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in index 3e8c642..b3fc986 100755 --- a/tools/virt-pki-validate.in +++ b/tools/virt-pki-validate.in @@ -297,7 +297,7 @@ Alternatively report bugs to your software distributor / vendor. =head1 COPYRIGHT -Copyright 2006-2009 by Red Hat, Inc +Copyright (C) 2006-2009 by Red Hat, Inc =head1 LICENSE diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in index 03bd1a1..19a68b7 100644 --- a/tools/virt-xml-validate.in +++ b/tools/virt-xml-validate.in @@ -134,7 +134,7 @@ Alternatively report bugs to your software distributor / vendor. =head1 COPYRIGHT -Copyright 2009 by Red Hat, Inc +Copyright (C) 2009 by Red Hat, Inc Copyright 2009 by Daniel P. Berrange =head1 LICENSE

On 03/18/2010 09:45 AM, Jim Meyering wrote:
ACK. Mechanical, comment-only change.
One suggestion: consistency-adding changes are great, but they're worth much more when accompanied by syntax-check style rules that ensure future consistency, too.
OK, working on that in cfg.mk now... -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

* cfg.mk (sc_copyright_format): New rule. Suggested by Jim Meyering. --- I tested that 'make syntax-check' with this patch rebased in place prior to the copyright updates catches the problems, but that when applied to the top of the tree it passes. cfg.mk | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/cfg.mk b/cfg.mk index 9fc2d66..e60820d 100644 --- a/cfg.mk +++ b/cfg.mk @@ -269,6 +269,15 @@ sc_preprocessor_indentation: echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ fi +sc_copyright_format: + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat \ + | grep -v Inc \ + && { echo '$(ME): use correct Red Hat copyright' 1>&2; \ + exit 1; } || : + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright [^(].*Red 'Hat \ + && { echo '$(ME): use correct Red Hat copyright' 1>&2; \ + exit 1; } || : + # We don't use this feature of maint.mk. prev_version_file = /dev/null -- 1.6.6.1

Eric Blake wrote:
* cfg.mk (sc_copyright_format): New rule. Suggested by Jim Meyering. ---
I tested that 'make syntax-check' with this patch rebased in place prior to the copyright updates catches the problems, but that when applied to the top of the tree it passes.
cfg.mk | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/cfg.mk b/cfg.mk index 9fc2d66..e60820d 100644 --- a/cfg.mk +++ b/cfg.mk @@ -269,6 +269,15 @@ sc_preprocessor_indentation: echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ fi
+sc_copyright_format: + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat \ + | grep -v Inc \ + && { echo '$(ME): use correct Red Hat copyright' 1>&2; \ + exit 1; } || : + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright [^(].*Red 'Hat \ + && { echo '$(ME): use correct Red Hat copyright' 1>&2; \ + exit 1; } || : + # We don't use this feature of maint.mk. prev_version_file = /dev/null
Thanks! In each diagnostic, it'd be nice to say what's missing. "Inc." in the first, "(C)" in the second. In the second, isn't s/correct/consistent/ more appropriate? Or is there some legal guidance saying that the (C) is required? I seem to recall reading that at least with FSF copyrights, the "(C)" is optional, and without legal value. The only problem I can see is that when/if adding copyright year numbers (non-range notation), eventually, some copyright lines will be split, causing this check to report false-positive matches. This is another argument for using YYYY-ZZZZ year ranges, when possible, rather than writing them out as Y1, Y2, Y3, ... YN.

* cfg.mk (sc_copyright_format): New rule. --- Jim wrote:
In each diagnostic, it'd be nice to say what's missing. "Inc." in the first, "(C)" in the second.
In the second, isn't s/correct/consistent/ more appropriate? Or is there some legal guidance saying that the (C) is required? I seem to recall reading that at least with FSF copyrights, the "(C)" is optional, and without legal value.
Yes, the FSF ruling was that (C) is optional, at least for FSF-copyrighted files. I don't know if Red Hat has another policy; but hopefully the wording below works better. cfg.mk | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/cfg.mk b/cfg.mk index 9fc2d66..2d0d278 100644 --- a/cfg.mk +++ b/cfg.mk @@ -269,6 +269,15 @@ sc_preprocessor_indentation: echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ fi +sc_copyright_format: + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat \ + | grep -v Inc \ + && { echo '$(ME): Red Hat copyright is missing Inc' 1>&2; \ + exit 1; } || : + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright [^(].*Red 'Hat \ + && { echo '$(ME): consistently use (C) in Red Hat copyright' 1>&2; \ + exit 1; } || : + # We don't use this feature of maint.mk. prev_version_file = /dev/null -- 1.6.6.1

Eric Blake wrote:
* cfg.mk (sc_copyright_format): New rule. ... +sc_copyright_format: + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat \ + | grep -v Inc \ + && { echo '$(ME): Red Hat copyright is missing Inc' 1>&2; \ + exit 1; } || : + @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright [^(].*Red 'Hat \ + && { echo '$(ME): consistently use (C) in Red Hat copyright' 1>&2; \ + exit 1; } || :
Thanks for the touch-up. I've pushed that.

Eric Blake wrote:
Spell out 'Red Hat, Inc.': git grep -i 'Copyright.*Red Hat' | grep -v Inc
Include (C) consistently: git grep -i 'Copyright [^(].*Red Hat'
* src/lxc/lxc_container.c: Update copyright formatting. * src/node_device/node_device_udev.c: Likewise. * src/node_device/node_device_udev.h: Likewise. * src/xen/xend_internal.h: Likewise. * src/xen/xm_internal.c: Likewise. * src/xen/xm_internal.h: Likewise. * tests/xmconfigtest.c: Likewise. * tests/object-locking.ml: Likewise. --- src/lxc/lxc_container.c | 4 ++-- src/node_device/node_device_udev.c | 2 +- src/node_device/node_device_udev.h | 2 +- src/xen/xend_internal.h | 2 +- src/xen/xm_internal.c | 2 +- src/xen/xm_internal.h | 2 +- tests/object-locking.ml | 2 +- tests/xmconfigtest.c | 2 +-
For the record, here's the updated patch I'll soon push:
From 0a3363357979fd8c08332baed12dca446684ce0e Mon Sep 17 00:00:00 2001 From: Eric Blake <eblake@redhat.com> Date: Fri, 12 Mar 2010 10:47:26 -0700 Subject: [PATCH] maint: make Red Hat copyright notices consistent
Spell out 'Red Hat, Inc.': git grep -i 'Copyright.*Red Hat' | grep -v Inc Include (C) consistently: git grep -i 'Copyright [^(].*Red Hat' * src/lxc/lxc_container.c: Update copyright formatting. * src/node_device/node_device_udev.c: Likewise. * src/node_device/node_device_udev.h: Likewise. * src/xen/xend_internal.h: Likewise. * src/xen/xm_internal.c: Likewise. * src/xen/xm_internal.h: Likewise. * tests/xmconfigtest.c: Likewise. * tests/object-locking.ml: Likewise. * tools/virt-pki-validate.in: Likewise. * tools/virt-xml-validate.in: Likewise. --- src/lxc/lxc_container.c | 4 ++-- src/node_device/node_device_udev.c | 2 +- src/node_device/node_device_udev.h | 2 +- src/xen/xend_internal.h | 2 +- src/xen/xm_internal.c | 2 +- src/xen/xm_internal.h | 2 +- tests/object-locking.ml | 2 +- tests/xmconfigtest.c | 2 +- tools/virt-pki-validate.in | 2 +- tools/virt-xml-validate.in | 4 ++-- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 68b4656..706c796 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -1,6 +1,6 @@ /* - * Copyright IBM Corp. 2008 - * Copyright Red Hat 2008-2009 + * Copyright (C) 2008-2010 Red Hat, Inc. + * Copyright (C) 2008 IBM Corp. * * lxc_container.c: file description * diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 11e27e0..e3114fa 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1,7 +1,7 @@ /* * node_device_udev.c: node device enumeration - libudev implementation * - * Copyright (C) 2009-2010 Red Hat + * Copyright (C) 2009-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/node_device/node_device_udev.h b/src/node_device/node_device_udev.h index 8367494..cdaa142 100644 --- a/src/node_device/node_device_udev.h +++ b/src/node_device/node_device_udev.h @@ -1,7 +1,7 @@ /* * node_device_udev.h: node device enumeration - libudev implementation * - * Copyright (C) 2009 Red Hat + * Copyright (C) 2009-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/xen/xend_internal.h b/src/xen/xend_internal.h index 483253f..028a293 100644 --- a/src/xen/xend_internal.h +++ b/src/xen/xend_internal.h @@ -1,12 +1,12 @@ /* * xend_internal.h * + * Copyright (C) 2006-2008, 2010 Red Hat, Inc. * Copyright (C) 2005,2006 * * Anthony Liguori <aliguori@us.ibm.com> * Daniel Veillard <veillard@redhat.com> * - * Copyright 2006-2008 Red Hat * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file COPYING in the main directory of this archive diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c index 3d4624d..74bf0b6 100644 --- a/src/xen/xm_internal.c +++ b/src/xen/xm_internal.c @@ -1,7 +1,7 @@ /* * xm_internal.h: helper routines for dealing with inactive domains * - * Copyright (C) 2006-2007, 2009, 2010 Red Hat + * Copyright (C) 2006-2007, 2009-2010 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * This library is free software; you can redistribute it and/or diff --git a/src/xen/xm_internal.h b/src/xen/xm_internal.h index 37132ef..3ad3456 100644 --- a/src/xen/xm_internal.h +++ b/src/xen/xm_internal.h @@ -1,7 +1,7 @@ /* * xm_internal.h: helper routines for dealing with inactive domains * - * Copyright (C) 2006-2007 Red Hat + * Copyright (C) 2006-2007, 2010 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * This library is free software; you can redistribute it and/or diff --git a/tests/object-locking.ml b/tests/object-locking.ml index a4cd77d..1fddd51 100644 --- a/tests/object-locking.ml +++ b/tests/object-locking.ml @@ -1,7 +1,7 @@ (* * Analyse libvirt driver API methods for mutex locking mistakes * - * Copyright 2008-2009 Red Hat, Inc + * Copyright (C) 2008-2010 Red Hat, Inc * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index acb6d18..a199c72 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -1,7 +1,7 @@ /* * xmconfigtest.c: Test backend for xm_internal config file handling * - * Copyright (C) 2007 Red Hat + * Copyright (C) 2007, 2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in index 3e8c642..b3fc986 100755 --- a/tools/virt-pki-validate.in +++ b/tools/virt-pki-validate.in @@ -297,7 +297,7 @@ Alternatively report bugs to your software distributor / vendor. =head1 COPYRIGHT -Copyright 2006-2009 by Red Hat, Inc +Copyright (C) 2006-2009 by Red Hat, Inc =head1 LICENSE diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in index 03bd1a1..a296c7f 100644 --- a/tools/virt-xml-validate.in +++ b/tools/virt-xml-validate.in @@ -134,8 +134,8 @@ Alternatively report bugs to your software distributor / vendor. =head1 COPYRIGHT -Copyright 2009 by Red Hat, Inc -Copyright 2009 by Daniel P. Berrange +Copyright (C) 2009 by Red Hat, Inc +Copyright (C) 2009 by Daniel P. Berrange =head1 LICENSE -- 1.7.0.2.455.g91132
participants (2)
-
Eric Blake
-
Jim Meyering