From patchwork Fri Jun 3 07:04:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 54768 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 A58CA38391A3 for ; Fri, 3 Jun 2022 07:05:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A58CA38391A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1654239902; bh=DTNsDMWOp25tWkFVDgrU9WFCxSvol5UlzKCnDPe2pcI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=eQ+MhEdNCpivVvOJg1VLp2cJrFdVY6RNSvlNMxCMaqdXYVxFVHWmvlZtny4Oj05VD tF8nOjOyQyuxbZwq9mO+kOh5pNt7+8U42IhrorZ9d4b0eXV3YOkOHfBU2ybloeg40H HDvussFUxicpnc33BIOaZqxubsghrFmxouw64yAY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTPS id 62E36383A33B for ; Fri, 3 Jun 2022 07:04:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62E36383A33B Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 10CD5116C0D; Fri, 3 Jun 2022 03:04:33 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eSiZJD1fZuJ0; Fri, 3 Jun 2022 03:04:33 -0400 (EDT) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id C58B2116BFA; Fri, 3 Jun 2022 03:04:32 -0400 (EDT) Received: from livre (free-to-gw.home [172.31.160.161]) by free.home (8.15.2/8.15.2) with ESMTPS id 25374LGu090142 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Jun 2022 04:04:22 -0300 To: gcc-patches@gcc.gnu.org Subject: [PATCH, FYI] libcody: fix nonportable shell code in revision.stamp build rule Organization: Free thinker, does not speak for AdaCore Date: Fri, 03 Jun 2022 04:04:21 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alexandre Oliva via Gcc-patches From: Alexandre Oliva Reply-To: Alexandre Oliva Cc: Nathan Sidwell Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Two non-portable shell constructs have been long present in libcody's build rule for revision.stamp: $() instead of ``, and += to append to a shell variable. The former seems to work even when bash is operating as /bin/sh, but += doesn't, and it ends up trying to run revision+=M as a command name, and issuing an error as that command is (hopefully) not found. This patch replaces both constructs with more portable ones. Regstrapped on x86_64-linux-gnu. Checking in. for libcody/ChangeLog * Makefile.in (revision.stamp): Replace $() and += with more portable shell constructs. --- libcody/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcody/Makefile.in b/libcody/Makefile.in index 7eaf8ace8cebf..bb87468cb9a33 100644 --- a/libcody/Makefile.in +++ b/libcody/Makefile.in @@ -66,11 +66,11 @@ clean:: Makefile # FIXME: Delete revision.stamp: $(srcdir)/. - @revision=$$(git -C $(srcdir) rev-parse HEAD 2>/dev/null) ;\ + @revision=`git -C $(srcdir) rev-parse HEAD 2>/dev/null` ;\ if test -n "$$revision" ;\ then revision=git-$$revision ;\ if git -C $(srcdir) status --porcelain 2>/dev/null | grep -vq '^ ' ;\ - then revision+=M ;\ + then revision=$${revision}M ;\ fi ;\ else revision=unknown ;\ fi ;\