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: 1638602 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=fo81t3Q+; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LDv5g2cGXz9s0w for ; Fri, 3 Jun 2022 17:04:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 70BD43839198 for ; Fri, 3 Jun 2022 07:04:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70BD43839198 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1654239893; bh=DTNsDMWOp25tWkFVDgrU9WFCxSvol5UlzKCnDPe2pcI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=fo81t3Q+QmGIbu7fzuwAfsZI/5AF7awEHoxKjE7JatsaRD5skkTMwtlaOYKTOnjS8 +lDtqaoCDPDzib7i5rToGIz+DtYIFpNhXoz8v0YGo2u0wyRPUSUjYGUdAi0TFVfBzk H6ppqeYLQP8n0JpgsBoCDEGM/uwAD7sTGOW5pYik= 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+incoming=patchwork.ozlabs.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 ;\