]> git.eshelyaron.com Git - emacs.git/commitdiff
Check for more ‘find’ failures and port ‘find’
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Jul 2024 16:19:31 +0000 (09:19 -0700)
committerEshel Yaron <me@eshelyaron.com>
Wed, 17 Jul 2024 21:54:13 +0000 (23:54 +0200)
* Makefile.in (install-eln), configure.ac (emacs_cv_find_delete):
* make-dist: Use ‘find ... -exec CMD {} +’ rather than ‘find
... -exec CMD {} \;’ so that if CMD fails, ‘find’ fails too.
* Makefile.in (install-eln): Port to ‘find’ implementations that
behave differently from GNU ‘find’ when given an argument
that contains ‘{}’ within a longer string.  POSIX allows
this behavior.

(cherry picked from commit 7cda30602fcaeecd0072d980a99156812fc7f086)

Makefile.in
configure.ac
make-dist

index 9e890ec6c24911c6363f1a3d2cca1ddfcce26f70..1a3703a56abe645d09301dd0a0948b20985f2eb5 100644 (file)
@@ -915,8 +915,14 @@ install-etc:
 install-eln: lisp
 ifeq ($(HAVE_NATIVE_COMP),yes)
        umask 022 ; \
-       find native-lisp -type d -exec $(MKDIR_P) '$(ELN_DESTDIR){}' \; ; \
-       find native-lisp -type f -exec ${INSTALL_ELN} '{}' '$(ELN_DESTDIR){}' \;
+       find native-lisp -exec sh -c \
+         'for f in "$$@"; do \
+            if test -d "$$f"; then \
+              $(MKDIR_P) '\''$(ELN_DESTDIR)'\''"$$f" || exit; \
+            else \
+              $(INSTALL_ELN) "$$f" '\''$(ELN_DESTDIR)'\''"$$f"; \
+            fi || exit; \
+          done' - {} +
 endif
 
 ### Build Emacs and install it, stripping binaries while installing them.
index 26216f0f54918e147f18e912f152bdf3c39287e8..f4a98aefff65f3e58367a91c66a9a9c7fbffbfc4 100644 (file)
@@ -2060,7 +2060,7 @@ AC_CACHE_CHECK([for 'find' args to delete a file],
   [if touch conftest.tmp && find conftest.tmp -delete 2>/dev/null &&
       test ! -f conftest.tmp
    then emacs_cv_find_delete="-delete"
-   else emacs_cv_find_delete="-exec rm -f {} ';'"
+   else emacs_cv_find_delete="-exec rm -f {} +"
    fi])
 FIND_DELETE=$emacs_cv_find_delete
 AC_SUBST([FIND_DELETE])
index c8b0fcf4f24649adc2945adbb3cc4b4d6df034ff..fcf9b28e722ba6b302cd6ef897b462a6fc82af2f 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -464,7 +464,7 @@ if [ "${newer}" ]; then
   ## up an incremental distribution already has a running Emacs to byte-compile
   ## them with.
   find ${tempdir} \( -name '*.elc' -o ! -newer "${newer}" \) \
-    -exec rm -f {} \; || exit
+    -exec rm -f {} + || exit
 fi
 
 if [ "${make_tar}" = yes ]; then