]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix Python scripts to output the correct filename
authorJonathan Wakely <jwakely@redhat.com>
Tue, 19 Mar 2024 12:43:29 +0000 (12:43 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 19 Mar 2024 15:20:07 +0000 (15:20 +0000)
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
libstdc++-v3/include/bits/text_encoding-data.h
libstdc++-v3/include/bits/unicode-data.h
libstdc++-v3/scripts/gen_text_encoding_data.py

index 2341a442f6ae5032626f40c6305e88a9f877b08d..da2f6ee66bf4f82ef7dd16ea59124f512d65ec65 100755 (executable)
 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
index 81bd94e6c3a0dbe9530d143aad468f8afe016bb5..d6c34f895f5f6741679f95b3d20af19bb51d9c3b 100644 (file)
@@ -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.
 //
index 69b8f2926c3e0251b7aa4267d42354cc988e3bf1..e39a6c45f6c5633e730e666420ec3654e3dc6426 100644 (file)
@@ -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.
 //
index 13792b5f5e7d29eadc991fc4b7abff0ed4624299..e11b26e69fcaad68d7719fbfd5d409c679eb3b72 100755 (executable)
 
 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.
 //