From patchwork Fri Jan 14 09:28:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 50013 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 3E1613857C69 for ; Fri, 14 Jan 2022 09:28:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 2D20A3858C39 for ; Fri, 14 Jan 2022 09:28:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D20A3858C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EF7711F3BF for ; Fri, 14 Jan 2022 09:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642152506; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FM17VVpz+5JMHC2NZtFg4dUjJHlj4qm8NemL3uUCqaM=; b=S27Fdcyt1qRlYf5+rV3C9mXWGzNusmXLBMJBB1F2SAgEj2TRGFNQj4lpETQ7GjYW9Bl8n2 a7TBgOid7gG/AQS8uJDso9TbytgSqx1RdM9Fy8MOXk+acyKPI0lcgzNhs8Nym9gHWAywwo jxiZoh4p9anHZAh3ny8a6CEfw1r9utQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642152506; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FM17VVpz+5JMHC2NZtFg4dUjJHlj4qm8NemL3uUCqaM=; b=WX/ubLQyOTjHxXRxM0Cdp0ag20FOJtFEISzH2jIZXtc5wd0d/X+Gt12+KaYVcuOb8RuVLO PjptENO4EIRpC6Ag== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DFF5713EC6 for ; Fri, 14 Jan 2022 09:28:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Yz1zNTpC4WHaDwAAMHmgww (envelope-from ) for ; Fri, 14 Jan 2022 09:28:26 +0000 Message-ID: Date: Fri, 14 Jan 2022 10:28:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Start using check-MAINTAINERS.py instead of legacy maintainers-verify.sh. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 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 Sender: "Gcc-patches" Let's use the new Python script where I added new function check_effective_target_python3 that can be used for python3 detection. Ready to be installed? Thanks, Martin contrib/ChangeLog: * maintainers-verify.sh: Removed. gcc/testsuite/ChangeLog: * gcc.src/maintainers.exp: Start using check-MAINTAINERS.py. * lib/target-supports.exp: Add check_effective_target_python3. --- contrib/maintainers-verify.sh | 45 --------------------------- gcc/testsuite/gcc.src/maintainers.exp | 18 ++++++----- gcc/testsuite/lib/target-supports.exp | 12 +++++++ 3 files changed, 23 insertions(+), 52 deletions(-) delete mode 100755 contrib/maintainers-verify.sh diff --git a/contrib/maintainers-verify.sh b/contrib/maintainers-verify.sh deleted file mode 100755 index 226c158fdaa..00000000000 --- a/contrib/maintainers-verify.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2018 Free Software Foundation, Inc. -# -# This file is part of GCC. -# -# GCC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GCC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. - -if [ "$1" != "" ]; then - f="$1" -else - f=./MAINTAINERS -fi - -grep @ $f \ - | sed 's/[\t][\t]*/\t/g' \ - | awk -F '\t' \ - " -{ - if (NF == 2) { - name=\$1 - email=\$2 - if (names[name] == 1) { - printf \"Redundant in write approval: %s\n\", name - } - } else if (NF == 3 ) { - name=\$2 - email=\$3 - names[name] = 1 - } -} -" diff --git a/gcc/testsuite/gcc.src/maintainers.exp b/gcc/testsuite/gcc.src/maintainers.exp index 9ce84f76ac1..63361dd5e4b 100644 --- a/gcc/testsuite/gcc.src/maintainers.exp +++ b/gcc/testsuite/gcc.src/maintainers.exp @@ -14,22 +14,27 @@ # along with GCC; see the file COPYING3. If not see # . -load_lib "gcc-defs.exp" +load_lib "target-supports.exp" proc gcc_src_run_maintainers_verify_sh {} { - set script maintainers-verify.sh + set script check-MAINTAINERS.py global srcdir set rootdir $srcdir/../.. set contrib $rootdir/contrib - set maintainers $rootdir/MAINTAINERS - set verify_output [exec $contrib/$script $maintainers] - if { "$verify_output" == "" } { + if { ![check_effective_target_python3] } { + unsupported "$script python3 is missing" + return + } + + set result [remote_exec host $contrib/$script $maintainers] + set status [lindex $result 0] + if { $status == 0 } then { pass "$script" } else { - send_log "$verify_output\n" + send_log "$result\n" fail "$script" } } @@ -40,4 +45,3 @@ if ![gcc_parallel_test_run_p maintainers] { gcc_parallel_test_enable 0 gcc_src_run_maintainers_verify_sh gcc_parallel_test_enable 1 - diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index c1ad97c6bd2..12c5ca5da33 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -11722,3 +11722,15 @@ proc check_effective_target___OPTIMIZE__ {} { #endif } [current_compiler_flags]] } + +# Return 1 if python3 is available. + +proc check_effective_target_python3 { } { + set result [remote_exec host "python3 --version"] + set status [lindex $result 0] + if { $status == 0 } then { + return 1; + } else { + return 0; + } +}