From patchwork Tue Mar 19 15:34:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1913629 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AINgB1Wb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TzbQ23rLQz1yWn for ; Wed, 20 Mar 2024 02:35:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5FFBD385841F for ; Tue, 19 Mar 2024 15:35:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 DC5C93858CD1 for ; Tue, 19 Mar 2024 15:34:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC5C93858CD1 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 DC5C93858CD1 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=LCAUfEJcTwVM07UU8er1OHCaso6zryO+4fxLggdgF3FxN3NCcGW6wUN6Z5jgraStdetQRUCS4Oo0R61nOUyjmGD/tbsclMYp3MlkLVcEnNi1k42ChWuG8Gdi/vJ4oSaEcU+ET9CSR1DyJOsGdOHnPEzf2MN/9tjbg/ylc0ba3Cs= 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=czy6fcz1fWc954FgSVoYe105C6wUqr1uGyW41JvKdvOAI2KmJTJh1dyla2gcy9MM7dmJcjTOGW9ulIKUeRu5je33dn+mo+TIX/NFD/mQvnV9VLgil71UQNZ+TtqxGZr5bHjUz9UvQdsaxeyZfhR1m7lq8BHFPzuBz1/KK2jyK64= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710862477; 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=AINgB1Wb9kR9ZcV6q+0DjnzAUd6EPZFdf5LvHlU8Q29STIVhCvPMjWmadN75z2F88D+RHN wVssHNm5jHOknVKNK3T3bBnb10tJD/OGeU2CvoIu8HdJ4rs5SPU0dabIHJ15eu2+356Wir FpqJL8DtzQllUrNQ1yxZGtC2ziNbmB8= 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 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org 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. //