From patchwork Fri Apr 12 01:25:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 88391 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC8E23858429 for ; Fri, 12 Apr 2024 01:26: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.133.124]) by sourceware.org (Postfix) with ESMTPS id 377B53858D38 for ; Fri, 12 Apr 2024 01:25:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 377B53858D38 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 377B53858D38 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=1712885136; cv=none; b=rWL8ld6xvotjh+9gokAVcY5LyLcmV/MHf8Nj3wUV75BrQRBoeY+i9xgcA6uw3FNMQ6IM6YnBljC7yODU45oQJhIq5dLGMDuX3/Ouyr1B5I6FZjGqOGuzNpGCBd4hb1x6edC9JUBhPoPmdEzv5nVpe5zJfWv+EzcrhdI2ns16owo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712885136; c=relaxed/simple; bh=fC1mtifv8ijtyJW+C4pMNU+4qVHoyInInFklWmSeUaI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wZqRxnbQJIB26af9FP64NJQDLSypk+RtACvxklOEb/D8gxBy1UykRJevfaZMIUnC8gwLr7knfbHY+E+7Z9P5VU9MkLzQdLh9OK6FgE6BlvgdO8s61P0aLUpypggLpVSeb0JK+17WADgpkmP9HmXnokstr467j71QUw0UmPbFUMU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712885133; 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=w3+VzDC5YGGOQExUgzruH9iXHThcG0KjKYkYSisJfIQ=; b=P/bY9qYkRVrBz4BMfnjvmPH9SVDF9fVWEOh3PUt2q5BLvPSUU+9j/Y3YaaRpabxP9ArB2m kj+DPPBNzXa9FgqYEGcOLevcyLTzhoTE3BB4udgn6/coQzoRRnRaIPQhfT3HtJASMIRMKZ gKHpegebwU85GCQxe+wY8MeUmeDCkrw= 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-540-Z6fpe1ZzOPKnwJmeOYpI7w-1; Thu, 11 Apr 2024 21:25:31 -0400 X-MC-Unique: Z6fpe1ZzOPKnwJmeOYpI7w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 9F56C3C108CA for ; Fri, 12 Apr 2024 01:25:31 +0000 (UTC) Received: from pdp-11.lan (unknown [10.22.34.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88DB72026D06 for ; Fri, 12 Apr 2024 01:25:31 +0000 (UTC) From: Marek Polacek To: GCC Patches Subject: [PATCH] contrib: add cxx-dr-table.sh Date: Thu, 11 Apr 2024 21:25:24 -0400 Message-ID: <20240412012524.61221-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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+patchwork=sourceware.org@gcc.gnu.org Ok for trunk? -- >8 -- I use this script to keep up-to-date. I thought it might be good to have it in contrib/, so I've polished it a little bit. contrib/ChangeLog: * cxx-dr-table.sh: New file. --- contrib/cxx-dr-table.sh | 108 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 contrib/cxx-dr-table.sh base-commit: d1a21a6f9474e519926d20a7c6d664be03aff3ee diff --git a/contrib/cxx-dr-table.sh b/contrib/cxx-dr-table.sh new file mode 100755 index 00000000000..9d67d176cad --- /dev/null +++ b/contrib/cxx-dr-table.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# Script to check/update +# from . +# Use --generate only to add new DRs; don't use it to update the existing +# ones because it would rewrite the Notes column. +# Use --check to check if the existing entries need to be updated. +# May need $ iconv -f iso-8859-1 -t utf-8 cwg_toc.html > cwg_toc2.html + +# Written by Marek Polacek + +AWK=/usr/bin/awk +DIFF=/usr/bin/vimdiff +SED=/usr/bin/sed + +usage() +{ + echo "Usage: $0 --check cwg_toc.html ~/src/gcc-wwwdocs/htdocs/projects/cxx-dr-status.html" + echo " or: $0 --generate cwg_toc.html" +} + +fatal_usage() +{ + usage >&2 + exit 1 +} + +# Generate new DR entries. +do_generate() { + $AWK '/A NAME=/{ + # 2838 + num = gensub(/(<.+>)(<.+>)(<.+>)(.+)(<.+>)/, "\\4", "g", $0) + getline + # Eat + getline + # Eat 6.7.6 + getline + # open + status = gensub(/(<.+>)(.+)(<.+>)/, "\\2", "g", $0) + getline + # Eat + getline + title = $0 + + # Generate the HTML fragment. + if (status == "open" || status == "drafting") { + print " " + } else { + print " " + } + print " " num "" + print " " status "" + print " " title "" + if (status == "open" || status == "drafting") { + print " -" + } else { + print " ?" + } + print " " + print " " + }' $1 +} + +# Check existing DR entries against the ISO version. +do_check() { + # Generate a table from the upstream table: DR# + status + summary + # First, fix the quotes. + $SED -i $1 -e 's/\(“\|”\)/"/g' + $AWK '/A NAME=/{ print; getline; getline; getline; print; getline; getline; print }' $1 | \ + $AWK -v RS='<[^>]+>' -v ORS= '1' | iconv -f UTF-8 -t ASCII//TRANSLIT > $tmp1 + + # Generate a table from our table: DR# + status + summary + $AWK '/wg21.link.cwg/{ print; getline; print; getline; print }' $2 | \ + $AWK -v RS='<[^>]+>' -v ORS= '1' > $tmp2 + $SED -i $tmp2 -e 's/^[ \t]*//' + + # Compare the tables. + $DIFF $tmp1 $tmp2 +} + +if [ $# -lt 2 ]; then + fatal_usage +fi + +tmp1="$(mktemp)" +tmp2="$(mktemp)" + +cleanup() { + rm -f -- "$tmp1" "$tmp2" +} + +trap cleanup 0 + +case "$1" in + -c | --check) + if [ $# -lt 3 ]; then + fatal_usage + fi + do_check "$2" "$3" + ;; + -g | --generate) + do_generate "$2" + ;; + *) + fatal_usage + ;; +esac + +exit