]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libcody: fix nonportable shell code in revision.stamp build rule
authorAlexandre Oliva <oliva@adacore.com>
Fri, 3 Jun 2022 06:59:01 +0000 (03:59 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 3 Jun 2022 06:59:01 +0000 (03:59 -0300)
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.

libcody/Makefile.in

index 7eaf8ace8cebffe374c872fcfccff83722590568..bb87468cb9a33f60718dda00037552cd8c6d8fb1 100644 (file)
@@ -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 ;\