File: buildEclipseBuildSource.sh

package info (click to toggle)
eclipse 3.8.1-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 338,840 kB
  • ctags: 472,808
  • sloc: java: 2,762,042; ansic: 136,783; xml: 105,676; cpp: 35,759; jsp: 4,420; sh: 3,288; perl: 1,687; makefile: 232; python: 67; php: 24
file content (51 lines) | stat: -rwxr-xr-x 1,815 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

baseDir=$(pwd)
workDirectory=
eclipsebuildTag="master"

usage="usage:  <eclipse-build tag (ex. 0.7.0)> [-workdir <working directory>] [-eclipseBuildTag <eclipse-build tag to check out>]"

while [ $# -gt 0 ]
do
        case "$1" in
                -workdir) workDirectory="$2"; shift;;
                -workDir) workDirectory="$2"; shift;;
                -eclipseBuildTag) eclipsebuildTag="$2"; shift;;
                -eclipsebuildtag) eclipsebuildTag="$2"; shift;;
                -eclipsebuildTag) eclipsebuildTag="$2"; shift;;
                -help) echo $usage; exit 0;;
                --help) echo $usage; exit 0;;
                -h) echo $usage; exit 0;;
                *) eclipsebuildTag="$1";
        esac
        shift
done

if [ "x${workDirectory}x" = "xx" ]; then
  workDirectory=/tmp/eclipse-build
  echo "Working directory not set; using /tmp/eclipse-build."
fi

echo "Going to create source tarball for eclipse-build ${eclipsebuildTag}."

mkdir "${workDirectory}"
cd "${workDirectory}"
git clone git://git.eclipse.org/gitroot/linuxtools/org.eclipse.linuxtools.eclipse-build.git .
cd "${workDirectory}"
git archive --format=tar --prefix=eclipse-build-${eclipsebuildTag}/ ${eclipsebuildTag} | gzip >eclipse-build-${eclipsebuildTag}-tmp.tar.gz 
tar -xf eclipse-build-${eclipsebuildTag}-tmp.tar.gz
cd eclipse-build-${eclipsebuildTag}
mv eclipse-build eclipse-build-${eclipsebuildTag}
rm -rf .project .settings
mv -f eclipse-build-config eclipse-build-${eclipsebuildTag}
mv -f eclipse-build-feature eclipse-build-${eclipsebuildTag}
mv -f eclipse-build-${eclipsebuildTag}/* .
rm -fr eclipse-build-${eclipsebuildTag}
cd ..


tar caf eclipse-build-${eclipsebuildTag}.tar.xz eclipse-build-${eclipsebuildTag}
cd "${baseDir}"

echo "Built ${workDirectory}/eclipse-build-${eclipsebuildTag}.tar.xz"