public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-971] libcody: fix nonportable shell code in revision.stamp build rule
@ 2022-06-03  7:04 Alexandre Oliva
  0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2022-06-03  7:04 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:39ab2e4c3921136136cdb08ca5c81bd0c3fe7d73

commit r13-971-g39ab2e4c3921136136cdb08ca5c81bd0c3fe7d73
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Fri Jun 3 03:59:01 2022 -0300

    libcody: fix nonportable shell code in revision.stamp build rule
    
    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.
    
    
    for  libcody/ChangeLog
    
            * Makefile.in (revision.stamp): Replace $() and += with more
            portable shell constructs.

Diff:
---
 libcody/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcody/Makefile.in b/libcody/Makefile.in
index 7eaf8ace8ce..bb87468cb9a 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 ;\


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-03  7:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03  7:04 [gcc r13-971] libcody: fix nonportable shell code in revision.stamp build rule Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).