From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 34F703856089 for ; Tue, 12 Sep 2023 11:45:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34F703856089 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694519137; 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=lX9Pjb8Z0DknZSTKvvwAn9M6/B8KttZgM1YUB/5I37A=; b=dGhnyhQTEvQSE8US8Iwb9ftKqAI5aGRhAPUmJ310RP92KT/mP6B/uO8snSX/7+TL7E1KCm 1ZB/Cy8Gmav2uSaZhMPXes5bqUGa/40+otXdR1crlHa8eCaFryDBoa0+ZBV7WIR0UIc6pd tz6+yfuIJUVtbxaSqLty6e95v998LHg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-228-WJV5-AcmNCehCFuYCXk5wQ-1; Tue, 12 Sep 2023 07:45:35 -0400 X-MC-Unique: WJV5-AcmNCehCFuYCXk5wQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 645E23C025D8; Tue, 12 Sep 2023 11:45:35 +0000 (UTC) Received: from localhost (unknown [10.42.28.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 293E940C6EA8; Tue, 12 Sep 2023 11:45:35 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] contrib: Quote variable in test expression [PR111360] Date: Tue, 12 Sep 2023 12:45:21 +0100 Message-ID: <20230912114534.1978778-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Committed as obvious. -- >8 -- Without the quotes some shells will always return true and some will print an error. It should be quoted so that a null variable works as intended. contrib/ChangeLog: PR other/111360 * gcc_update: Quote variable. --- contrib/gcc_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gcc_update b/contrib/gcc_update index 1d7bfab4935..cda2bdb0df9 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -343,7 +343,7 @@ case $vcs_type in revision=`$GCC_GIT log -n1 --pretty=tformat:%h` r=`$GCC_GIT describe --all --match 'basepoints/gcc-[0-9]*' HEAD \ | sed -n 's,^\(tags/\)\?basepoints/gcc-\([0-9]\+\)-\([0-9]\+\)-g[0-9a-f]*$,r\2-\3,p;s,^\(tags/\)\?basepoints/gcc-\([0-9]\+\)$,r\2-0,p'`; - if test -n $r; then + if test -n "$r"; then o=`$GCC_GIT config --get gcc-config.upstream`; rr=`echo $r | sed -n 's,^r\([0-9]\+\)-[0-9]\+\(-g[0-9a-f]\+\)\?$,\1,p'`; if $GCC_GIT rev-parse --verify --quiet ${o:-origin}/releases/gcc-$rr >/dev/null; then -- 2.41.0