[PATCH] Work around a bash-ism in configure.in

Mike Eberdt libreme at comcast.net
Fri Jul 15 12:09:31 PDT 2011


---
 configure.in |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 9ad2f52..71dbb5b 100755
--- a/configure.in
+++ b/configure.in
@@ -1309,7 +1309,10 @@ dnl check for required programs (grep, awk, sed, bash)
 dnl ===================================================================
 cat /dev/null > warn
 
-if test "$EUID" -eq "0"  -a "z`uname -o 2>/dev/null`" = "zCygwin" ; then
+# $EUID is a bash-ism, so we can't assume its existence.  Unfortunately, some
+# shells (e.g. FreeBSD sh) will _always_ evaluate both sides of "test X -a Y",
+# so we use "test X && test Y" to avoid on-screen spewage about a "bad number".
+if test "z`uname -o 2>/dev/null`" = "zCygwin" && test "$EUID" -eq 0; then
     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
 fi
 
-- 
1.7.6


--------------000905070309010405010402--


More information about the LibreOffice mailing list