Hello guys,

I think I spotted a small mistake in the freecol.sh script.
You use test -d there which is used to look for a directory. Actually
we want to look for a jar file in that directory, so we should use test
-r.

Let me know what you think.
Patch is attached to this mail.

jubalh
>From 7f20b91cc4f2875553e0d7cdf905736513a12c61 Mon Sep 17 00:00:00 2001
From: Michael Vetter <jub...@openmailbox.org>
Date: Tue, 20 Sep 2016 11:33:40 +0200
Subject: [PATCH] Fix testing of jar in FHS location

Since we look for a jar `test -d` is wrong and we should look for a
readable jar file.
---
 packaging/common/freecol.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packaging/common/freecol.sh b/packaging/common/freecol.sh
index 35d80d8..2a4d57d 100755
--- a/packaging/common/freecol.sh
+++ b/packaging/common/freecol.sh
@@ -66,7 +66,7 @@ elif test -r "${FREECOLJAR}" ; then
 elif test -r "${BINDIR}/${FREECOLJAR}" ; then
     FCJAR="${BINDIR}/${FREECOLJAR}"
 # - Is it in a likely linux FHS place?
-elif test -d "/usr/share/java/${FREECOLJAR}" ; then
+elif test -r "/usr/share/java/${FREECOLJAR}" ; then
     FCJAR="/usr/share/java/${FREECOLJAR}"
 # Give up.
 else
-- 
2.10.0

------------------------------------------------------------------------------
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to