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: 194354 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1537944dyb; Tue, 30 Jan 2024 14:39:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMAl+0ncUddYHfDx77sBRI/kec55NRcvT+iQo4j5r+6YzM1KiiXGA1zzHyLrxha5k9JEiS X-Received: by 2002:a25:ab86:0:b0:dc2:202b:6ce5 with SMTP id v6-20020a25ab86000000b00dc2202b6ce5mr8090610ybi.26.1706654368826; Tue, 30 Jan 2024 14:39:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706654368; cv=pass; d=google.com; s=arc-20160816; b=qjJSdY7AzpmHLpuucOQud8UA3tPCsROu8h4QerwR74mJT/jYiM5lYVwwOSJJBNkYVV hZyGgXxNmCPduba+mzFlVhp3SJE10PZ80oPpE9HitL2UNPpzGV86/YzgLQHm2FUxolQk b+b5Mf2v4KKllCDlgefj+So6BWVBK2lDyBcO6OmMGho7Gg8Or4VEOOC0Avm3R+N/8l1A HMV52A+SSKC+TGk6Cuze8frqU5rxsH3rcZi5pEhII2ySb2qXUNTzURtZzbUEML7UttDZ If6NcSx8QCZ998p/hsVHHcttdt+wf/iQpxrxPmwDV56Kb0i7VybjTKUE4EBXUm/y47wo aSiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition:in-reply-to :mime-version:message-id:subject:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=VvSH4JhtUmC5v41btdRW9Imr4XTIHwjrZS9SxPyOC5k=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=zM1DAiuMkOcEgWT4exdnGZH+nEdN1pkgR3uUHpq6qDcvTZZRoh8DrPNSfsGUS8w3z7 49ynEBgu40o4SazLZO0hwautvrIBZrwc5c+64gdHHc+aAPyPCcQk2VcoSxN6AegGlZwo GMjJmOgjJNOHvLsEwoKm+IA6v2Q0fUze3T0gvQmlNH8RMBsOHaRWujDX1nU+Ul2rzGMU djGNagLsCQjjdAImTVu3SOR7n4aSA7/FSjh/LDTpgPNfnUeVeVIyBCBWDlBgTwed4hur LFL12V6sY62QifKZh1xUGYn2k4I70IOs5vlcaQaelmYrwLI+5UQSjrJm4doTi7BYh1Hp n/rQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RYDBQC/G"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s12-20020a05620a29cc00b007833177257esi11912531qkp.557.2024.01.30.14.39.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 14:39:28 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RYDBQC/G"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DF6F3857C7C for ; Tue, 30 Jan 2024 21:36:00 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789532144774489358 X-GMAIL-MSGID: 1789556811794890028 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: