From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 3DFD43858D37 for ; Tue, 19 Mar 2024 15:34:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DFD43858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3DFD43858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710862480; cv=none; b=ZHjS2tf2xwYPaoXirwYb41HOv3jhq6yKFuVO5iuxMBTV4HWvlMKmtjSyXphVye0XIlGU8QhtSgyQ59MJUgeAeAn2HtgQAy8i2es7MfqNbN14eZszcQ7+KdWGGNeotjQeAGQi5OLkkP03dVhj54WHC+MwXlKjm7LeZxKZg+rFlfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710862480; c=relaxed/simple; bh=Klyb4vqO9bD2UE10sb10RTHwPMbSq8ypIcL6gHbBjJo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JDKpA1mxNBw1FQ6ic0riLuwGF1KasduhIcLQGiJKRUbqpuJgdWlKs64cjry+tpEm9Nt3uJ3z5X2EhZ2FW2fQ3RRIAbG2pq/l+KiIPTxZl41qoO2WVO0djdXx5XyXvhZ8h0CxyDH+mP0RDvBLSaa3KyGD9N4pVb+SUEuN7DsDkvA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710862475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IO7K7l2V6Mm4zWIMgMSafGgpKb4T3AVrornX4aYTN7Y=; b=aMTd2xNx8N20VHghfWhG4kOKUcbZlUtG0hfcwvpGWXIBsPO3xzu9o1f6Bx4RTEAQPfI/+p HnlmH+sp4NCWXwA8HV8aHw2yZLH8DVo3VGJj3CFGe7qYqImwpr1ROmvnfYQl4FLc28ykfm x2/yj3Sb9urojTgWfyXYa8RdAs5v24o= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-EHWh6ZNGMvqw7VBYeegY5A-1; Tue, 19 Mar 2024 11:34:34 -0400 X-MC-Unique: EHWh6ZNGMvqw7VBYeegY5A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2783B28EC10E; Tue, 19 Mar 2024 15:34:34 +0000 (UTC) Received: from localhost (unknown [10.42.28.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9C261C060A6; Tue, 19 Mar 2024 15:34:33 +0000 (UTC) From: Jonathan Wakely 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 Message-ID: <20240319153429.3385605-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 " % 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