Skip to main content
summaryrefslogtreecommitdiffstats
blob: cb06c157e731da1c88450d2cbbffd0d0c9155bf5 (plain) (blame)
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
#!/bin/bash -e

BASE=$(dirname $0)
source composite.index

if [ "$DIRS" == "" ]; then
  echo "missing DIRS"
  exit 1
fi

if [ "$NAME" == "" ]; then
  echo "missing NAME"
  exit 1
fi

TIMESTAMP=$(date +%s)000

compose() {
cat > $FILE <<EOF
<?xml version='1.0' encoding='UTF-8'?>
<?TAG version='1.0.0'?>
<repository name='NAME' type='TYPE' version='1.0.0'>
  <properties size='2'>
    <property name='p2.compressed' value='true'/>
    <property name='p2.timestamp' value='TIMESTAMP'/>
  </properties>
  <children size='CHILD_COUNT'>
EOF

sed -i -e "s/TAG/$TAG/" -e "s/TYPE/$TYPE/" $FILE
sed -i -e "s/NAME/$NAME/" -e "s/TIMESTAMP/$TIMESTAMP/" $FILE
COUNT=0
for i in $DIRS; do
  echo "    <child location='$i'/>" >> $FILE
  COUNT=$((COUNT+1))
done
sed -i -e "s/CHILD_COUNT/$COUNT/" $FILE

cat >> $FILE <<EOF
  </children>
</repository>
EOF

echo "Wrote $COUNT entries to $FILE"
}

FILE=compositeArtifacts.xml
TAG=compositeArtifactRepository
TYPE=org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository

compose

FILE=compositeContent.xml
TAG=compositeMetadataRepository
TYPE=org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository

compose

Back to the top