blob: c474688965f31feb51d11a48af563279fca3e0e1 [file] [log] [blame]
#!/bin/sh
#
# script to update PTP versions
#
# Usage: update_versions ptp_version photran_version
#
# ptp_version - new version string for PTP (e.g. "3.0.1")
# photran_version - new version string for Photran (e.g. "5.0.1")
#
# Note: a "qualifier" suffix will automatically be added to the version where appropriate
#
TMP_DIR=/tmp
if [ $# -lt 2 ]; then
echo "usage: update_versions ptp_version photran_version"
exit 1
fi
ptp_version=$1
photran_version=$2
PTP_FEATURES="\
org.eclipse.ptp-feature \
org.eclipse.ptp.core-feature \
org.eclipse.ptp.etfw-feature \
org.eclipse.ptp.etfw.ppw-feature \
org.eclipse.ptp.etfw.tau-feature \
org.eclipse.ptp.etfw.tau.fortran-feature \
org.eclipse.ptp.external-feature \
org.eclipse.ptp.gem-feature \
org.eclipse.ptp.master \
org.eclipse.ptp.pldt-feature \
org.eclipse.ptp.pldt.lapi-feature \
org.eclipse.ptp.pldt.upc-feature \
org.eclipse.ptp.rdt-feature \
org.eclipse.ptp.rdt.remotejars-feature \
org.eclipse.ptp.rdt.remotetools-feature \
org.eclipse.ptp.rdt.sync-feature \
org.eclipse.ptp.rdt.sync.fortran-feature \
org.eclipse.ptp.rdt.xlc-feature \
org.eclipse.ptp.remote-feature \
org.eclipse.ptp.remote.remotetools-feature \
org.eclipse.ptp.remote.rse-feature \
org.eclipse.ptp.remotetools-feature \
org.eclipse.ptp.rm.ibm.ll-feature \
org.eclipse.ptp.rm.ibm.pe-feature \
org.eclipse.ptp.rm.jaxb-feature \
org.eclipse.ptp.rm.jaxb.pbs-feature \
org.eclipse.ptp.rm.lml_jaxb-feature \
org.eclipse.ptp.rm.lml-feature \
org.eclipse.ptp.rm.mpich2-feature \
org.eclipse.ptp.rm.openmpi-feature \
org.eclipse.ptp.rm.slurm-feature \
org.eclipse.ptp.sci-feature \
org.eclipse.ptp.sdk-feature \
org.eclipse.ptp.sdm-feature \
org.eclipse.ptp.services-feature \
org.eclipse.ptp.utils-feature"
PHOTRAN_FEATURES="\
org.eclipse.photran-feature \
org.eclipse.photran.intel-feature \
org.eclipse.photran.xlf-feature \
org.eclipse.rephraserengine-feature"
PTP_PLUGINS="\
org.eclipse.ptp.aix.ppc \
org.eclipse.ptp.linux.ppc \
org.eclipse.ptp.linux.x86 \
org.eclipse.ptp.linux.x86_64 \
org.eclipse.ptp.macosx.ppc \
org.eclipse.ptp.macosx.x86 \
org.eclipse.ptp"
PTP_C_PROJECTS="\
org.eclipse.ptp.debug.sdm \
org.eclipse.ptp.proxy \
org.eclipse.ptp.rm.ibm.pe.proxy \
org.eclipse.ptp.rm.ibm.ll.proxy \
org.eclipse.ptp.rm.slurm.proxy \
org.eclipse.ptp.sci \
org.eclipse.ptp.utils"
update_feature() {
sed -e "s/^\([ \t]*\)version=\"[0-9]\.[0-9]\.[0-9]\.qualifier\"/\1version=\"$2\.qualifier\"/" < $1/feature.xml > $TMP_DIR/${1}_feature.xml
mv $TMP_DIR/${1}_feature.xml $1/feature.xml
}
update_manifest() {
sed -e "s/^\([ \t]*\)Bundle-Version: *[0-9]\.[0-9]\.[0-9]\.qualifier/\1Bundle-Version: $2.qualifier/" < $1/META-INF/MANIFEST.MF > $TMP_DIR/${1}_MANIFEST.MF
mv $TMP_DIR/${1}_MANIFEST.MF $1/META-INF/MANIFEST.MF
}
for feature in $PTP_FEATURES; do
echo "Updating $feature..."
update_feature $feature $ptp_version
done
for plugin in $PTP_PLUGINS; do
echo "Updating $plugin..."
update_manifest $plugin $ptp_version
done
for project in $PTP_C_PROJECTS; do
echo "Updating $project..."
update_manifest $project $ptp_version
done
for feature in $PHOTRAN_FEATURES; do
echo "Updating $feature..."
update_feature $feature $photran_version
done
echo "Updating org.eclipse.ptp.releng..."
sed -e "s/<property name=\"ptpBranchVersion\" value=\"[0-9]\.[0-9]\.[0-9]\"\/>/<property name=\"ptpBranchVersion\" value=\"$ptp_version\"\/>/" \
-e "s/<property name=\"photranBranchVersion\" value=\"[0-9]\.[0-9]\.[0-9]\"\/>/<property name=\"photranBranchVersion\" value=\"$photran_version\"\/>/" \
< org.eclipse.ptp.releng/build.xml > $TMP_DIR/org.eclipse.ptp.releng_build.xml
mv $TMP_DIR/org.eclipse.ptp.releng_build.xml org.eclipse.ptp.releng/build.xml
echo "Updating org.eclipse.ptp.rdt.core.remotejars.."
sed -e "s/<property name=\"serverVersion\" value=\"[0-9]\.[0-9]\.[0-9]\"\/>/<property name=\"serverVersion\" value=\"$ptp_version\"\/>/" \
< org.eclipse.ptp.rdt.core.remotejars/build.xml > $TMP_DIR/org.eclipse.ptp.rdt.core.remotejars_build.xml
mv $TMP_DIR/org.eclipse.ptp.rdt.core.remotejars_build.xml org.eclipse.ptp.rdt.core.remotejars/build.xml
exit 0