]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: port single_binary_prog to POSIX shell
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jun 2015 19:15:35 +0000 (12:15 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jun 2015 19:16:04 +0000 (12:16 -0700)
Problem reported privately by Michael Felt.
* Makefile.am (install-exec-hook):
* src/local.mk (src/coreutils_symlinks, src/coreutils_shebangs)
(clean-local):
Port to POSIX shell, which doesn't allow 'for i in ; do ...'.

Makefile.am
src/local.mk

index 7d7e3812ad649dc8a95e5ec6cf07117307415621..f5543ddb919b2d30c8a7cc91a477c080d29c65ce 100644 (file)
@@ -195,7 +195,8 @@ check-git-hook-script-sync:
 # the selected tools when installing.
 install-exec-hook:
        $(AM_V_at)ctrans=$$(printf coreutils | sed -e "$(transform)");  \
-       for p in $(single_binary_progs); do                             \
+       for p in x $(single_binary_progs); do                           \
+         test $$p = x && continue;                                     \
          ptrans=$$(printf '%s' "$$p" | sed -e "$(transform)");         \
          rm -f $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?;      \
          if test "x$(single_binary_install_type)" = xshebangs; then    \
index 5a3b1b31548b56c59e60aed9541d49281f8042b1..eaeed08e7b71ffc7554cc3ba1b84dc8b157a97aa 100644 (file)
@@ -427,7 +427,8 @@ endif SINGLE_BINARY
 CLEANFILES += src/coreutils_symlinks
 src/coreutils_symlinks: Makefile
        $(AM_V_GEN)touch $@
-       $(AM_V_at)for i in $(single_binary_progs); do \
+       $(AM_V_at)for i in x $(single_binary_progs); do \
+               test $$i = x && continue; \
                rm -f src/$$i$(EXEEXT) || exit $$?; \
                $(LN_S) -s coreutils$(EXEEXT) src/$$i$(EXEEXT) || exit $$?; \
        done
@@ -435,7 +436,8 @@ src/coreutils_symlinks: Makefile
 CLEANFILES += src/coreutils_shebangs
 src/coreutils_shebangs: Makefile
        $(AM_V_GEN)touch $@
-       $(AM_V_at)for i in $(single_binary_progs); do \
+       $(AM_V_at)for i in x $(single_binary_progs); do \
+               test $$i = x && continue; \
                rm -f src/$$i$(EXEEXT) || exit $$?; \
                printf '#!%s --coreutils-prog-shebang=%s\n' \
                        $(abs_top_builddir)/src/coreutils$(EXEEXT) $$i \
@@ -444,7 +446,8 @@ src/coreutils_shebangs: Makefile
        done
 
 clean-local:
-       $(AM_V_at)for i in $(single_binary_progs); do \
+       $(AM_V_at)for i in x $(single_binary_progs); do \
+               test $$i = x && continue; \
                rm -f src/$$i$(EXEEXT) || exit $$?; \
        done