File: eclipse-copy-platform.sh

package info (click to toggle)
eclipse 3.5.2-6squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 297,208 kB
  • ctags: 426,326
  • sloc: java: 2,527,099; ansic: 122,607; xml: 100,868; cpp: 33,545; jsp: 3,869; sh: 2,557; perl: 1,650; makefile: 272; csh: 151; python: 69; php: 24
file content (77 lines) | stat: -rw-r--r-- 2,443 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /bin/sh

# We need to make our own copy of the eclipse platform in order to
# build against it.  We do this since the build root might already
# contain a copy of the plugin we are building -- and the eclipse
# releng scripts fail in this situation.  We put this script in the
# eclipse core so that it is easy to use from other spec files.

# Arguments are:
# * directory where results should end up (script will make it)
# * base location of eclipse platform install
# * an optional string that is used to select non-platform
#   plugins and features.  At present if a plugin or feature has
#   this as a substring, it will be included.  You need only run
#   this script once, it will link both the platform and the other
#   optionally-selected parts in a single invocation.

# Test to see if the minimum arguments
# are specified

if [ $# -lt 2 ]; then
  echo "Usage: copy-platform where eclipse_base optional_directories"
  echo "For example: copy-plaform ~/SDK /usr/lib/eclipse cdt pydev jdt"
  exit 1
fi

where=$1; shift
eclipse=$1; shift

datadir=/usr/share/eclipse

mkdir -p $where/plugins $where/features
cd $where

# Are there any optional arguments left?
if [ $# -gt 0 ]; then
   for optional in "$@"; do
      (cd $eclipse; ls -d plugins/*"$optional"* features/*"$optional"*) |
      while read f; do
         [ ! -e $f ] && ln -s $eclipse/$f $f
      done
      (cd $eclipse/dropins; ls -d *"$optional"*) |
      while read f; do
	  if [ -e $eclipse/dropins/$f/eclipse ]; then
	      (cd $eclipse/dropins/$f/eclipse; ls -d plugins/* features/*) |
	      while read g; do
		  [ ! -e $g ] && \
		    ln -s $eclipse/dropins/$f/eclipse/$g $g
	      done
          else
	      (cd $eclipse/dropins/$f; ls -d plugins/* features/*) |
	      while read g; do
	          [ ! -e $g ] && \
		    ln -s $eclipse/dropins/$f/$g $g
	      done
          fi
      done
      (cd $datadir/dropins; ls -d *"$optional"*) |
      while read f; do
	  if [ -e $datadir/dropins/$f/eclipse ]; then
	      (cd $datadir/dropins/$f/eclipse; ls -d plugins/* features/*) |
	      while read g; do
		  [ ! -e $g ] && \
		    ln -s $datadir/dropins/$f/eclipse/$g $g
	      done
          else
	      (cd $datadir/dropins/$f; ls -d plugins/* features/*) |
	      while read g; do
	          [ ! -e $g ] && \
		    ln -s $datadir/dropins/$g $g
	      done
          fi
      done
   done
fi

# Code after this point is automatically created by eclipse.spec.