2012-06-11 17:14:37 +00:00
|
|
|
#! /bin/sh
|
2014-02-26 14:09:50 +00:00
|
|
|
set -e
|
2012-06-11 17:14:37 +00:00
|
|
|
|
2012-10-11 13:58:11 +00:00
|
|
|
sdk=$1'-sdk'
|
|
|
|
repo=$1
|
2012-06-11 17:14:37 +00:00
|
|
|
|
2014-02-26 14:09:50 +00:00
|
|
|
echo Building system local p2 repository... >&2
|
|
|
|
|
2014-02-24 18:09:02 +00:00
|
|
|
eclipse=$(rpm --eval '%{_libdir}')/eclipse
|
2012-12-03 17:38:48 +00:00
|
|
|
|
2014-02-24 18:09:02 +00:00
|
|
|
datadir=/usr/share/eclipse
|
|
|
|
javadir=/usr/share/java
|
|
|
|
jnidir=/usr/lib/java
|
2013-12-17 00:59:22 +00:00
|
|
|
|
|
|
|
launcher="/usr/lib*/eclipse/plugins/org.eclipse.equinox.launcher_*.jar"
|
|
|
|
if [ ! -e ${launcher} ]; then
|
|
|
|
launcher="$(pwd)/tycho-bundles/tycho-bundles-external/target/eclipse/plugins/org.eclipse.equinox.launcher_*.jar"
|
|
|
|
fi
|
2012-06-11 17:14:37 +00:00
|
|
|
|
2014-02-26 14:09:50 +00:00
|
|
|
trap "rm -rf $sdk" 0
|
2012-10-11 13:58:11 +00:00
|
|
|
mkdir -p $sdk/plugins $sdk/features
|
2014-02-26 14:09:50 +00:00
|
|
|
pushd $sdk >/dev/null
|
2012-06-11 17:14:37 +00:00
|
|
|
|
|
|
|
(cd $eclipse;
|
|
|
|
ls -d plugins/* features/* 2>/dev/null) |
|
|
|
|
while read f; do
|
|
|
|
[ ! -e $f ] && ln -s $eclipse/$f $f
|
|
|
|
done
|
|
|
|
(cd $eclipse/dropins; ls -d * 2>/dev/null) |
|
|
|
|
while read f; do
|
|
|
|
if [ -e $eclipse/dropins/$f/eclipse ]; then
|
|
|
|
(cd $eclipse/dropins/$f/eclipse;
|
|
|
|
ls -d plugins/* features/* 2>/dev/null) |
|
|
|
|
while read g; do
|
|
|
|
[ ! -e $g ] && \
|
|
|
|
ln -s $eclipse/dropins/$f/eclipse/$g $g
|
|
|
|
done
|
|
|
|
else
|
|
|
|
(cd $eclipse/dropins/$f;
|
|
|
|
ls -d plugins/* features/* 2>/dev/null) |
|
|
|
|
while read g; do
|
|
|
|
[ ! -e $g ] && \
|
|
|
|
ln -s $eclipse/dropins/$f/$g $g
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
(cd $datadir/dropins; ls -d * 2>/dev/null) |
|
|
|
|
while read f; do
|
|
|
|
if [ -e $datadir/dropins/$f/eclipse ]; then
|
|
|
|
(cd $datadir/dropins/$f/eclipse;
|
|
|
|
ls -d plugins/* features/* 2>/dev/null) |
|
|
|
|
while read g; do
|
|
|
|
[ ! -e $g ] && \
|
|
|
|
ln -s $datadir/dropins/$f/eclipse/$g $g
|
|
|
|
done
|
|
|
|
else
|
|
|
|
(cd $datadir/dropins/$f;
|
|
|
|
ls -d plugins/* features/* 2>/dev/null) |
|
|
|
|
while read g; do
|
|
|
|
[ ! -e $g ] && \
|
2012-07-30 18:48:52 +00:00
|
|
|
ln -s $datadir/dropins/$f/$g $g
|
2012-06-11 17:14:37 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for p in $(ls -d $eclipse/dropins/jdt/plugins/*); do
|
|
|
|
plugin=$(basename $p)
|
|
|
|
[ ! -e plugins/$plugin ] && ln -s $eclipse/dropins/jdt/plugins/$plugin plugins/$plugin
|
|
|
|
done
|
|
|
|
for f in $(ls -d $eclipse/dropins/jdt/features/*); do
|
|
|
|
feature=$(basename $f)
|
|
|
|
[ ! -e features/$feature ] && ln -s $eclipse/dropins/jdt/features/$feature features/$feature
|
|
|
|
done
|
|
|
|
for p in $(ls -d $eclipse/dropins/sdk/plugins/*); do
|
|
|
|
plugin=$(basename $p)
|
|
|
|
[ ! -e plugins/$plugin ] && ln -s $eclipse/dropins/sdk/plugins/$plugin plugins/$plugin
|
|
|
|
done
|
|
|
|
for f in $(ls -d $eclipse/dropins/sdk/features/*); do
|
|
|
|
feature=$(basename $f)
|
|
|
|
[ ! -e features/$feature ] && ln -s $eclipse/dropins/sdk/features/$feature features/$feature
|
|
|
|
done
|
|
|
|
for p in $(ls -d $eclipse/plugins/*); do
|
|
|
|
plugin=$(basename $p)
|
|
|
|
[ ! -e plugins/$plugin ] && ln -s $eclipse/plugins/$plugin plugins/$plugin
|
|
|
|
done
|
|
|
|
for f in $(ls -d $eclipse/features/*); do
|
|
|
|
feature=$(basename $f)
|
|
|
|
[ ! -e features/$feature ] && ln -s $eclipse/features/$feature features/$feature
|
|
|
|
done
|
|
|
|
|
2012-10-10 17:36:29 +00:00
|
|
|
# jars in %%{_javadir} may not be uniquely named
|
|
|
|
id=1
|
2014-02-24 18:09:02 +00:00
|
|
|
for p in $(find $javadir $jnidir -name "*.jar"); do
|
2014-02-26 14:09:50 +00:00
|
|
|
if unzip -p $p 'META-INF/MANIFEST.MF' | grep -q 'Bundle-SymbolicName'; then
|
2013-07-05 14:14:12 +00:00
|
|
|
plugin=${id}-$(basename $p)
|
|
|
|
[ ! -e plugins/$plugin ] && ln -s $p plugins/$plugin
|
|
|
|
id=$((${id} + 1))
|
|
|
|
fi
|
|
|
|
done
|
2012-06-11 17:14:37 +00:00
|
|
|
|
2014-02-26 14:09:50 +00:00
|
|
|
popd >/dev/null
|
2012-06-11 17:14:37 +00:00
|
|
|
|
2014-02-26 14:09:50 +00:00
|
|
|
(set -x
|
2013-12-17 00:59:22 +00:00
|
|
|
java -jar ${launcher} -nosplash -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher \
|
2012-06-11 17:14:37 +00:00
|
|
|
-metadataRepository file:$repo \
|
|
|
|
-artifactRepository file:$repo \
|
2012-10-11 13:58:11 +00:00
|
|
|
-source $sdk \
|
2014-02-26 14:09:50 +00:00
|
|
|
-compress -append -publishArtifacts)
|
2012-06-11 17:14:37 +00:00
|
|
|
|
2014-02-26 14:09:50 +00:00
|
|
|
# In debugging mode dump contents of local p2 repo
|
|
|
|
if [ x"$2" = x-X ]; then
|
|
|
|
echo === begin local p2 repo dump ===
|
|
|
|
find $repo -name \*.jar
|
|
|
|
echo === end local p2 repo dump ===
|
|
|
|
fi
|