From c7da892cb23d50d4d85746c9a0b6b14bf570989d Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 13:23:09 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- scripts/find-version | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 scripts/find-version (limited to 'scripts/find-version') diff --git a/scripts/find-version b/scripts/find-version new file mode 100755 index 0000000..55fbc58 --- /dev/null +++ b/scripts/find-version @@ -0,0 +1,62 @@ +#!/bin/sh + +help () +{ + echo "Find the installed plugin/feature version of a eclipse build environment" + echo "Usage: $0 [pluginId1/featureId1[,pluginId2/featureId2]...]"; + echo "" + echo "Options:" + echo "pluginId/featureId - comma seperated plugin or feature ids, empty for all" + echo "" + echo "Example: $0 org.eclipse.tcf.feature.group"; + exit 1; +} + +fail () +{ + local retval=$1 + shift $1 + echo "[Fail $retval]: $*" + echo "BUILD_TOP=${BUILD_TOP}" + cd ${TOP} + exit ${retval} +} + +find_eclipse_base () +{ + [ -d ${ECLIPSE_HOME}/plugins ] && ECLIPSE_BASE=`readlink -f ${ECLIPSE_HOME}` +} + +find_launcher () +{ + local list="`ls ${ECLIPSE_BASE}/plugins/org.eclipse.equinox.launcher_*.jar`" + for launcher in $list; do + [ -f $launcher ] && LAUNCHER=${launcher} + done +} + +check_env () +{ + find_eclipse_base + find_launcher + + local err=0 + [ "x${ECLIPSE_BASE}" = "x" -o "x${LAUNCHER}" = "x" ] && err=1 + if [ $err -eq 0 ]; then + [ ! -d ${ECLIPSE_BASE} ] && err=1 + [ ! -f ${LAUNCHER} ] && err=1 + fi + + if [ $err -ne 0 ]; then + echo "Please set env variable ECLIPSE_HOME to the eclipse installation directory!" + exit 1 + fi +} + +if [ $# -ne 0 ] && [ $# -ne 1 ]; then + help +fi + +check_env + +java -jar ${LAUNCHER} -application org.eclipse.equinox.p2.director -destination ${ECLIPSE_BASE} -profile SDKProfile -repository file:///${ECLIPSE_BASE}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile -list $@ -- cgit v1.2.3-54-g00ecf