public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Fix Python scripts to output the correct filename
Date: Tue, 19 Mar 2024 15:34:05 +0000	[thread overview]
Message-ID: <20240319153429.3385605-1-jwakely@redhat.com> (raw)

Tested x86_64-linux. Pushed to trunk.

-- >8 --

These scripts both print "generated by $file, do not edit" header but
one of them prints the wrong filename. Use the built-in __file__
attribute to ensure it's correct.

contrib/ChangeLog:

	* unicode/gen_libstdcxx_unicode_data.py: Fix header of generated
	file to name the correct script.

libstdc++-v3/ChangeLog:

	* include/bits/text_encoding-data.h: Regenerate.
	* include/bits/unicode-data.h: Regenerate.
	* scripts/gen_text_encoding_data.py: Fix header of generated
	file to name the correct script.
---
 contrib/unicode/gen_libstdcxx_unicode_data.py  | 6 ++++--
 libstdc++-v3/include/bits/text_encoding-data.h | 3 ++-
 libstdc++-v3/include/bits/unicode-data.h       | 2 +-
 libstdc++-v3/scripts/gen_text_encoding_data.py | 5 ++++-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/contrib/unicode/gen_libstdcxx_unicode_data.py b/contrib/unicode/gen_libstdcxx_unicode_data.py
index 2341a442f6a..da2f6ee66bf 100755
--- a/contrib/unicode/gen_libstdcxx_unicode_data.py
+++ b/contrib/unicode/gen_libstdcxx_unicode_data.py
@@ -29,9 +29,11 @@
 import sys
 import re
 import math
+import os
 
-print("""// Generated by contrib/unicode/gen_std_format_width.py, do not edit.
-
+self = os.path.basename(__file__)
+print("// Generated by contrib/unicode/{}, do not edit.".format(self))
+print("""
 // Copyright The GNU Toolchain Authors.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
diff --git a/libstdc++-v3/include/bits/text_encoding-data.h b/libstdc++-v3/include/bits/text_encoding-data.h
index 81bd94e6c3a..d6c34f895f5 100644
--- a/libstdc++-v3/include/bits/text_encoding-data.h
+++ b/libstdc++-v3/include/bits/text_encoding-data.h
@@ -1,4 +1,5 @@
-// Generated by gen_text_encoding_data.py, do not edit.
+// Generated by scripts/gen_text_encoding_data.py, do not edit.
+
 
 // Copyright The GNU Toolchain Authors.
 //
diff --git a/libstdc++-v3/include/bits/unicode-data.h b/libstdc++-v3/include/bits/unicode-data.h
index 69b8f2926c3..e39a6c45f6c 100644
--- a/libstdc++-v3/include/bits/unicode-data.h
+++ b/libstdc++-v3/include/bits/unicode-data.h
@@ -1,4 +1,4 @@
-// Generated by contrib/unicode/gen_std_format_width.py, do not edit.
+// Generated by contrib/unicode/gen_libstdcxx_unicode_data.py, do not edit.
 
 // Copyright The GNU Toolchain Authors.
 //
diff --git a/libstdc++-v3/scripts/gen_text_encoding_data.py b/libstdc++-v3/scripts/gen_text_encoding_data.py
index 13792b5f5e7..e11b26e69fc 100755
--- a/libstdc++-v3/scripts/gen_text_encoding_data.py
+++ b/libstdc++-v3/scripts/gen_text_encoding_data.py
@@ -26,12 +26,15 @@
 
 import sys
 import csv
+import os
 
 if len(sys.argv) != 2:
     print("Usage: %s <character sets csv>" % sys.argv[0], file=sys.stderr)
     sys.exit(1)
 
-print("""// Generated by gen_text_encoding_data.py, do not edit.
+self = os.path.basename(__file__)
+print("// Generated by scripts/{}, do not edit.".format(self))
+print("""
 
 // Copyright The GNU Toolchain Authors.
 //
-- 
2.44.0


                 reply	other threads:[~2024-03-19 15:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240319153429.3385605-1-jwakely@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).