diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:23:09 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:24:09 +0200 |
commit | c7da892cb23d50d4d85746c9a0b6b14bf570989d (patch) | |
tree | e7136073f386d6156f51766c498c52c30c8df85f /scripts/find-version | |
download | eclipse-poky-kepler-daisy.tar.gz |
initial commit for Enea Linux 4.0daisy
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'scripts/find-version')
-rwxr-xr-x | scripts/find-version | 62 |
1 files changed, 62 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | help () | ||
4 | { | ||
5 | echo "Find the installed plugin/feature version of a eclipse build environment" | ||
6 | echo "Usage: $0 [pluginId1/featureId1[,pluginId2/featureId2]...]"; | ||
7 | echo "" | ||
8 | echo "Options:" | ||
9 | echo "pluginId/featureId - comma seperated plugin or feature ids, empty for all" | ||
10 | echo "" | ||
11 | echo "Example: $0 org.eclipse.tcf.feature.group"; | ||
12 | exit 1; | ||
13 | } | ||
14 | |||
15 | fail () | ||
16 | { | ||
17 | local retval=$1 | ||
18 | shift $1 | ||
19 | echo "[Fail $retval]: $*" | ||
20 | echo "BUILD_TOP=${BUILD_TOP}" | ||
21 | cd ${TOP} | ||
22 | exit ${retval} | ||
23 | } | ||
24 | |||
25 | find_eclipse_base () | ||
26 | { | ||
27 | [ -d ${ECLIPSE_HOME}/plugins ] && ECLIPSE_BASE=`readlink -f ${ECLIPSE_HOME}` | ||
28 | } | ||
29 | |||
30 | find_launcher () | ||
31 | { | ||
32 | local list="`ls ${ECLIPSE_BASE}/plugins/org.eclipse.equinox.launcher_*.jar`" | ||
33 | for launcher in $list; do | ||
34 | [ -f $launcher ] && LAUNCHER=${launcher} | ||
35 | done | ||
36 | } | ||
37 | |||
38 | check_env () | ||
39 | { | ||
40 | find_eclipse_base | ||
41 | find_launcher | ||
42 | |||
43 | local err=0 | ||
44 | [ "x${ECLIPSE_BASE}" = "x" -o "x${LAUNCHER}" = "x" ] && err=1 | ||
45 | if [ $err -eq 0 ]; then | ||
46 | [ ! -d ${ECLIPSE_BASE} ] && err=1 | ||
47 | [ ! -f ${LAUNCHER} ] && err=1 | ||
48 | fi | ||
49 | |||
50 | if [ $err -ne 0 ]; then | ||
51 | echo "Please set env variable ECLIPSE_HOME to the eclipse installation directory!" | ||
52 | exit 1 | ||
53 | fi | ||
54 | } | ||
55 | |||
56 | if [ $# -ne 0 ] && [ $# -ne 1 ]; then | ||
57 | help | ||
58 | fi | ||
59 | |||
60 | check_env | ||
61 | |||
62 | 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 $@ | ||