From patchwork Tue Jan 30 21:35:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1893127 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=RYDBQC/G; 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 4TPdkb1Jy7z1yQ0 for ; Wed, 31 Jan 2024 08:35:35 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2563C38582A1 for ; Tue, 30 Jan 2024 21:35:33 +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.133.124]) by sourceware.org (Postfix) with ESMTPS id 244FB3858C30 for ; Tue, 30 Jan 2024 21:35:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 244FB3858C30 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 244FB3858C30 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706650512; cv=none; b=O2KiWmXlZwQXvhcUtb4WVdg56hHU3xSyUPdbuUIYcxXdqqGAE402epbX/sImaxgrSjDF7uZvpMNkPyquxHqP/4m8824A5B94grFVv9Ox06iGBWNit6LxETRoHvGmrkWXXENI4U2bkvkfL2FcB2ZreVbRh3VPnSiUpJnfbRh3FPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706650512; c=relaxed/simple; bh=H0BF0QcZvaGgPWt8ni5DYF5nfHckafUe/tgo1oKJ9Mw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=lzGTY7n8xex6MeKMGu7IJVitf0ZjbC1r1CsSRS4uPlFsFoE+7VPkhNs/ufNtTiLJvrmENvUcl6kZxVzgvLrkeUibauVsl4j+KUTneVIM4OAIdwEgFbpwCH1s/wi4fkc1e7fY0xxLr11yMMkEJvmEeJnXgT5widmUMZobsLVg3nM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706650510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=VvSH4JhtUmC5v41btdRW9Imr4XTIHwjrZS9SxPyOC5k=; b=RYDBQC/G8oYL9lHNfrobu3QeqDWGedBoJTNDdNDKIVSmpqMfH/e1AxbVpKBF2HRgAI888e FPCpFGX90Hy2L20Rgh4bd1ad7tdPKwrV+gfkupMHbu9+cEInGVlAANShV6Wzr0yPgu6i0c oTRlm5CLSbaReAKLHSgnvDB+xUj1KAA= 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-318-HqBCPkB0PeyN2qlHEvg2Ig-1; Tue, 30 Jan 2024 16:35:09 -0500 X-MC-Unique: HqBCPkB0PeyN2qlHEvg2Ig-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 EABED1C05EC6; Tue, 30 Jan 2024 21:35:08 +0000 (UTC) Received: from localhost (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id B95BC492BC6; Tue, 30 Jan 2024 21:35:08 +0000 (UTC) Date: Tue, 30 Jan 2024 21:35:08 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH v2] mklog: Add lookup for new generated files in libstdc++ Message-ID: MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-12.7 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_H3, 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 On 30/01/24 15:02 +0000, Jonathan Wakely wrote: >That way other subdirectories could add their own extra generated files to it. Like so. mklog: Add lookup for generated files in specific sub-directories The mklog.py output for libstdc++-v3/include/bits/version.h is awful. Teaching mklog.py that it's generated makes it correctly use "Regenerate" for its changes. We can do the same for the other new generated headers as well. This change adds a new dict with directories as keys, and a set of filenames as the values. The location of the ChangeLog file can be looked up in the dict and then the relative_path looked up in the set. contrib/ChangeLog: * mklog.py (subdir_generated_files): New dict of per-directory generated files. (generate_changelog): Use subdir_generated_files. diff --git a/contrib/mklog.py b/contrib/mklog.py index d764fb41f99..b9631f92600 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -92,6 +92,12 @@ function_extensions = {'.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def', '.md'} # NB: Makefile.in isn't listed as it's not always generated. generated_files = {'aclocal.m4', 'config.h.in', 'configure'} +subdir_generated_files = { +'libstdc++-v3': { 'include/bits/version.h', + 'include/bits/text_encoding-data.h' + 'include/bits/unicode-data.h' } +} + help_message = """\ Generate ChangeLog template for PATCH. PATCH must be generated using diff(1)'s -up or -cp options @@ -284,6 +290,9 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False, elif os.path.basename(file.path) in generated_files: out += '\t* %s: Regenerate.\n' % (relative_path) append_changelog_line(out, relative_path, 'Regenerate.') + elif relative_path in subdir_generated_files.get(changelog, {}): + out += '\t* %s: Regenerate.\n' % (relative_path) + append_changelog_line(out, relative_path, 'Regenerate.') else: if not no_functions: for hunk in file: