From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 9A9C33860776; Tue, 19 Mar 2024 15:34:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A9C33860776 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710862445; bh=372JzY73Reg7dus1DdFfD2b+4TnnG2vjzVKlMdZCJqY=; h=From:To:Subject:Date:From; b=aHk7tRbm2spCRF9iQn03AW5sdb1ltBVQx2wufPDjBvFdY4drvy4YgJIObdbjzM47K 0e+azBFVQwuHUsHPFTOgqo7mTfSQX8sL8QOCzj8jcogUgjPXtI4J+y65nTF/HKw2sd AlzUdrmHPSGNeQUzE6Ij4tTiot9WKct6ziRpEUBQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-9547] libstdc++: Fix Python scripts to output the correct filename X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: f5118546a8d0a99edb34fd672e7847370a1adae1 X-Git-Newrev: ef2efc53fd89920a864fa076cabe03873b7f1bdc Message-Id: <20240319153405.9A9C33860776@sourceware.org> Date: Tue, 19 Mar 2024 15:34:05 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ef2efc53fd89920a864fa076cabe03873b7f1bdc commit r14-9547-gef2efc53fd89920a864fa076cabe03873b7f1bdc Author: Jonathan Wakely Date: Tue Mar 19 12:43:29 2024 +0000 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. Diff: --- 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 " % 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. //