summaryrefslogtreecommitdiffstats
blob: adc6cd047b7139db2a9274df1cb9427e6e88a440 (plain)
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
#!/bin/bash

# /*******************************************************************************
# * Copyright (c) 27.04.2012 Aaron Digulla.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
# * http://www.eclipse.org/legal/epl-v10.html
# *
# * Contributors:
# *    Aaron Digulla - initial API and implementation and/or initial documentation
# *******************************************************************************/

set -o pipefail

# Format:
# MissingSources org.eclipse.orbit:orbit.com.google.guava:10.0.1
missingOrbitBundles="$1"

version="R20120119162704"
baseUrl="http://download.eclipse.org/tools/orbit/downloads/drops/${version}/repository"

mapFile="tmp/orbitBundles-${version}.p2.map"

if [[ ! -e "$mapFile" ]]; then
    ( cd tmp ; wget "${baseUrl}/orbitBundles-${version}.p2.map" ; ) || exit 1
fi

while read line ; do
    set -- $( echo "$line" | sed -e 's/:/ /g' )
        
    if [[ "$1" != "MissingSources" ]]; then
        echo "Expected 'MissingSources': ${line}"
        continue
    fi
        
    groupId="$2"
    if [[ "${groupId}" != "org.eclipse.orbit" ]]; then
        echo "Not an orbit bundle -> ignore: ${line}"
        continue
    fi
    
    artifactId=$( echo "$3" | sed -e 's/^orbit\.//' ).source
    version="$4"
    
    echo "Looking for ${groupId}:${artifactId}:${version}"
    
    key="plugin@${artifactId},${version}=p2IU"
    p2line=$(grep "${key}" "${mapFile}")
    rc=$?
    if [[ ${rc} -ne 0 ]]; then
        echo "${line}"
        continue
    fi
    
    bundleVersion=$( echo "${p2line}" | sed -e 's/^.*version=//' -e 's/,.*$//' )
    
    url="$url '${baseUrl}/plugins/${artifactId}_${bundleVersion}.jar'"
done < "${missingOrbitBundles}"

#echo $url

export target=${target:-target}
eval ./run.sh download $url

exit 0