Update Copyright for gen-evolution.awk and gen-cxxapi-file.py

Message ID aWFKGplnXjEl2SYC@tucnak
State New
Headers
Series Update Copyright for gen-evolution.awk and gen-cxxapi-file.py |

Commit Message

Jakub Jelinek Jan. 9, 2026, 6:34 p.m. UTC
  On Fri, Jan 09, 2026 at 06:28:00PM +0000, Joseph Myers wrote:
> On Fri, 9 Jan 2026, Jakub Jelinek wrote:
> 
> > On Fri, Jan 09, 2026 at 05:54:47PM +0000, Joseph Myers wrote:
> > > I think updates to gcc/config/loongarch/genopts/gen-evolution.awk's calls 
> > > to copyright_header are needed as well.  At present, building for 
> > > loongarch can result in files in the source tree being reverted to older 
> > > copyright dates because the generation hasn't been updated (discovered via 
> > > my glibc bot with GCC mainline stopping updating its GCC source tree 
> > > because such modifications appeared in the sources).  Of course this also 
> > > shows up missing entries in contrib/gcc_update for the three files 
> > > generated by gen-evolution.awk.
> > 
> > gen-evolution.awk is explicitly blacklisted:
> 
> The issue is that the files it generates still got updated - and then when 
> gen-evolution.awk got called during a build, it reverted the changes to 
> those generated files in the source tree.

Here it is in patch form.
Seems to work in my limited testing.

Ok for trunk?

2026-01-09  Jakub Jelinek  <jakub@redhat.com>

contrib/
	* update-copyright.py (GCCFilter): Don't filter out
	gen-evolution.awk and gen-cxxapi-file.py.
gcc/
	* config/loongarch/genopts/gen-evolution.awk: Update
	copyright year.
	(copyright_header): Separate parts of Copyright word
	with " " so that it doesn't get matched by update-copyright.py.
	(gen_full_header, gen_full_source, gen_full_def): Include
	2026 year in the ranges.
gcc/cp/
	* gen-cxxapi-file.py: Update copyright year.  Separate
	parts of Copyright word with {:s} so that it doesn't get matched
	by update-copyright.py.



	Jakub
  

Comments

Joseph Myers Jan. 9, 2026, 8:47 p.m. UTC | #1
On Fri, 9 Jan 2026, Jakub Jelinek wrote:

> 2026-01-09  Jakub Jelinek  <jakub@redhat.com>
> 
> contrib/
> 	* update-copyright.py (GCCFilter): Don't filter out
> 	gen-evolution.awk and gen-cxxapi-file.py.
> gcc/
> 	* config/loongarch/genopts/gen-evolution.awk: Update
> 	copyright year.
> 	(copyright_header): Separate parts of Copyright word
> 	with " " so that it doesn't get matched by update-copyright.py.
> 	(gen_full_header, gen_full_source, gen_full_def): Include
> 	2026 year in the ranges.
> gcc/cp/
> 	* gen-cxxapi-file.py: Update copyright year.  Separate
> 	parts of Copyright word with {:s} so that it doesn't get matched
> 	by update-copyright.py.

OK.
  

Patch

--- contrib/update-copyright.py.jj	2026-01-02 09:56:09.889341212 +0100
+++ contrib/update-copyright.py	2026-01-09 19:24:43.028123083 +0100
@@ -560,8 +560,6 @@  class GCCFilter (GenericFilter):
 
                 # Weird ways to compose copyright year
                 'GmcOptions.cc',
-                'gen-evolution.awk',
-                'gen-cxxapi-file.py',
                 ])
 
         self.skip_dirs |= set ([
--- gcc/config/loongarch/genopts/gen-evolution.awk.jj	2025-11-12 18:23:21.299849847 +0100
+++ gcc/config/loongarch/genopts/gen-evolution.awk	2026-01-09 19:18:33.070338911 +0100
@@ -3,7 +3,7 @@ 
 # A simple script that generates loongarch-evolution.h
 # from genopts/isa-evolution.in
 #
-# Copyright (C) 2021-2025 Free Software Foundation, Inc.
+# Copyright (C) 2021-2026 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -49,10 +49,12 @@  BEGIN {
 function copyright_header(from_year,to_year)
 {
     if (to_year == "")
-      print "   Copyright (C) " from_year \
+      # The weird " " in the middle of a word is to make
+      # contrib/update_copyright.py happy.
+      print "   Copy" "right (C) " from_year \
 	    " Free Software Foundation, Inc."
     else
-      print "   Copyright (C) " from_year "-" to_year \
+      print "   Copy" "right (C) " from_year "-" to_year \
 	    " Free Software Foundation, Inc."
     print ""
     print "This file is part of GCC."
@@ -165,7 +167,7 @@  function gen_full_header()
     print "   Please do not edit this file directly."
     print ""
 
-    copyright_header(2023, 2025)
+    copyright_header(2023, 2026)
 
     print "*/"
     print ""
@@ -201,7 +203,7 @@  function gen_full_source()
     print "   Please do not edit this file directly."
     print ""
 
-    copyright_header(2023, 2025)
+    copyright_header(2023, 2026)
 
     print "*/"
     print ""
@@ -244,7 +246,7 @@  function gen_full_def()
     print "   Please do not edit this file directly."
     print ""
 
-    copyright_header(2025)
+    copyright_header(2025, 2026)
 
     print "*/"
     print ""
--- gcc/cp/gen-cxxapi-file.py.jj	2025-04-08 14:08:50.204296441 +0200
+++ gcc/cp/gen-cxxapi-file.py	2026-01-09 19:22:31.120334993 +0100
@@ -1,6 +1,6 @@ 
 #!/usr/bin/env python3
 
-# Copyright (C) 2022-2025 Free Software Foundation, Inc.
+# Copyright (C) 2022-2026 Free Software Foundation, Inc.
 # This file is part of GCC.
 
 # GCC is free software; you can redistribute it and/or modify
@@ -95,7 +95,7 @@  def hints(script, content):
 %struct-type
 %{{
 /* This file is auto-generated by {:s}.  */
-/* Copyright (C) 2022-{:s} Free Software Foundation, Inc.
+/* Copy{:s}right (C) 2022-{:s} Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -130,7 +130,7 @@  struct std_name_hint
 # as defined in the C++ language specification.  The result is used in the
 # get_std_name_hint functions.
 #   throws an exception.
-#""".format(script, time.strftime('%Y')))
+#""".format(script, "", time.strftime('%Y')))
     header = ''
     printed_header = False
     for e in content: