tycho/tycho-debundle.sh
2014-09-10 09:59:02 +02:00

26 lines
577 B
Bash
Executable File

#! /bin/bash
. $(pwd)/tycho-scripts.sh
projLoc=$1
zipLoc=$2
mfLoc=$3
zipDir=`dirname ${zipLoc}`
zipFile=`basename ${zipLoc}`
tmpDir=${zipDir}/tmp
[ -z "$mfLoc" ] && mfLoc=/dev/null
mkdir -p ${tmpDir}
unzip -d ${tmpDir} ${zipLoc}
wantedBundles=`sed 's/ fragment=\"true\"//' ${projLoc}/*.product | sed -n 's/.*<plugin id=\"\(.*\)\"\/>.*/\1/ p'`
pushd ${tmpDir}
pluginsDir=`find . -type d -name plugins`
pushd ${pluginsDir} && rm -rf *
symlinkBundles "${wantedBundles}"
for b in *; do readlink $b; done >$mfLoc
popd
zip -ry ${zipFile} *
popd
mv ${tmpDir}/${zipFile} ${zipLoc}