From 5c20aa7486f9cb8871f40bca9ac5fee09caefca3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 8 Feb 2015 16:00:17 -0800 Subject: [PATCH] Port to platforms lacking test -a and -o * configure.ac (HAVE_LIBXML2): * lisp/Makefile.in (compile-clean): * lisp/net/tramp-sh.el (tramp-find-executable): Prefer '&&' and '||' to 'test -a' and 'test -o'. --- ChangeLog | 6 ++++++ configure.ac | 10 +++++----- lisp/ChangeLog | 7 +++++++ lisp/Makefile.in | 2 +- lisp/net/tramp-sh.el | 2 +- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 908ffe6230e..ab551e1f65f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-02-08 Paul Eggert + + Port to platforms lacking test -a and -o + * configure.ac (HAVE_LIBXML2): + Prefer '&&' and '||' to 'test -a' and 'test -o'. + 2015-02-08 Ulrich Müller * configure.ac (--with-gameuser): Default to 'games' group instead diff --git a/configure.ac b/configure.ac index 192634bdc45..6a5c73eda5c 100644 --- a/configure.ac +++ b/configure.ac @@ -3491,7 +3491,7 @@ if test "${with_xml2}" != "no"; then ### I'm not sure what the version number should be, so I just guessed. EMACS_CHECK_MODULES([LIBXML2], [libxml-2.0 > 2.6.17]) # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc. - if test "${HAVE_LIBXML2}" != "yes" -a "$opsys" = "darwin"; then + if test "${HAVE_LIBXML2}" != "yes" && test "$opsys" = "darwin"; then SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2" AC_CHECK_HEADER(libxml/HTMLparser.h, @@ -4508,10 +4508,10 @@ if test $emacs_cv_func_sigsetjmp = yes; then fi # We need all of these features to handle C stack overflows. -if test "$ac_cv_header_sys_resource_h" = "yes" -a \ - "$ac_cv_func_getrlimit" = "yes" -a \ - "$emacs_cv_func_sigsetjmp" = "yes" -a \ - "$emacs_cv_alternate_stack" = yes; then +if test "$ac_cv_header_sys_resource_h" = "yes" && + test "$ac_cv_func_getrlimit" = "yes" && + test "$emacs_cv_func_sigsetjmp" = "yes" && + test "$emacs_cv_alternate_stack" = yes; then AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], 1, [Define to 1 if C stack overflow can be handled in some cases.]) fi diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ad4f3b9a7f3..ce381315b40 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-02-08 Paul Eggert + + Port to platforms lacking test -a and -o + * Makefile.in (compile-clean): + * net/tramp-sh.el (tramp-find-executable): + Prefer '&&' and '||' to 'test -a' and 'test -o'. + 2015-02-08 Artur Malabarba * newcomment.el (comment-line): Fix missing paren. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 7bf53861e71..e5cfc6326e1 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -324,7 +324,7 @@ compile-clean: @cd $(lisp) && $(setwins); \ elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \ for el in `echo $$elcs | sed -e 's/\.elc/\.el/g'`; do \ - if test -f "$$el" -o \! -f "$${el}c"; then :; else \ + if test -f "$$el" || test ! -f "$${el}c"; then :; else \ echo rm "$${el}c"; \ rm "$${el}c"; \ fi \ diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 9c8a222285c..45050cdd77a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3796,7 +3796,7 @@ This function expects to be in the right *tramp* buffer." (tramp-send-command vec (format (concat "while read d; " - "do if test -x $d/%s -a -f $d/%s; " + "do if test -x $d/%s && test -f $d/%s; " "then echo tramp_executable $d/%s; " "break; fi; done <<'%s'\n" "%s\n%s") -- 2.39.2