libstdc++: Fix Python scripts to output the correct filename

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.
pull/46/merge
Jonathan Wakely 2024-03-19 12:43:29 +00:00
parent f5118546a8
commit ef2efc53fd
4 changed files with 11 additions and 5 deletions

View File

@ -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

View 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.
//

View 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.
//

View File

@ -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.
//