You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2017/11/28 08:45:34 UTC
[GitHub] ivankelly closed pull request #772: Explicitly search for bookkeeper-server jar
ivankelly closed pull request #772: Explicitly search for bookkeeper-server jar
URL: https://github.com/apache/bookkeeper/pull/772
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/bookkeeper-server/bin/bookkeeper b/bookkeeper-server/bin/bookkeeper
index a6a580671..f2b85faed 100755
--- a/bookkeeper-server/bin/bookkeeper
+++ b/bookkeeper-server/bin/bookkeeper
@@ -70,19 +70,28 @@ else
JAVA=$JAVA_HOME/bin/java
fi
-# exclude tests jar
-RELEASE_JAR=$(ls ${BK_HOME}/*bookkeeper-server-*.jar 2> /dev/null | grep -v tests | tail -1)
+find-server-jar() {
+ DIR=$1
+ cd $DIR
+ for f in *.jar; do
+ if [[ $f =~ ^bookkeeper-server-[0-9\\.]*(-SNAPSHOT)?.jar$ ]]; then
+ echo $DIR/$f
+ return
+ fi
+ done
+}
+
+RELEASE_JAR=$(find-server-jar ${BK_HOME})
if [ -n "${RELEASE_JAR}" ]; then
BOOKIE_JAR=${RELEASE_JAR}
else
- RELEASE_JAR=$(ls ${BK_HOME}/lib/*bookkeeper-server-*.jar 2> /dev/null | grep -v tests | tail -1)
+ RELEASE_JAR=$(find-server-jar ${BK_HOME}/lib)
if [ -n "${RELEASE_JAR}" ]; then
BOOKIE_JAR=${RELEASE_JAR}
fi
fi
-# exclude tests jar
-BUILT_JAR=$(ls ${BK_HOME}/target/*bookkeeper-server-*.jar 2> /dev/null | grep -v tests | tail -1)
+BUILT_JAR=$(find-server-jar ${BK_HOME}/target)
if [ -z "${BUILT_JAR}" ] && [ -z "${BOOKIE_JAR}" ]; then
echo "Couldn't find bookkeeper jar."
@@ -96,7 +105,7 @@ if [ -z "${BUILT_JAR}" ] && [ -z "${BOOKIE_JAR}" ]; then
;;
esac
- BUILT_JAR=$(ls ${BK_HOME}/target/*bookkeeper-server-*.jar 2> /dev/null | grep -v tests | tail -1)
+ BUILT_JAR=$(find-server-jar ${BK_HOME}/target)
if [ -n "${BUILT_JAR}" ]; then
BOOKIE_JAR=$BUILT_JAR
fi
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services