Consolidate update scripts to one location.
diff --git a/fixModules.xml b/fixModules.xml
new file mode 100644
index 0000000..08ad331
--- /dev/null
+++ b/fixModules.xml
@@ -0,0 +1,15 @@
+<project name="fixModules" default="fix">
+ <property name="newVersion" value="a.b.c"/>
+ <property name="repo" value="org.eclipse.ptp"/>
+
+ <target name="fix">
+ <xslt style="generateModules.xsl" in="${repo}/pom.xml" out="modules.xml">
+ <param name="newVersion" expression="${newVersion}"/>
+ <param name="repo" expression="${repo}"/>
+ </xslt>
+ <ant antfile="modules.xml">
+ <property name="newVersion" value="${newVersion}"/>
+ </ant>
+ <delete file="modules.xml"/>
+ </target>
+</project>
diff --git a/fixPom.xsl b/fixPom.xsl
new file mode 100644
index 0000000..14a1cf0
--- /dev/null
+++ b/fixPom.xsl
@@ -0,0 +1,84 @@
+<xsl:stylesheet version="2.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:p="http://maven.apache.org/POM/4.0.0"
+ exclude-result-prefixes="p xsi #default">
+
+ <xsl:param name="newVersion"/>
+
+ <xsl:output encoding="UTF-8" method="xml" indent="yes" />
+
+ <xsl:template match="p:project">
+ <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <xsl:copy-of select="namespace::*" />
+ <xsl:apply-templates />
+ </project>
+ </xsl:template>
+
+ <xsl:template match="p:version[preceding-sibling::p:groupId='org.eclipse.ptp']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+
+ <xsl:template match="p:version[preceding-sibling::p:groupId='org.eclipse.ptp.features']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.aix.ppc']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.linux.ppc']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.linux.x86']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.linux.x86_64']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.macosx.ppc']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.macosx.x86']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.debug.sdm']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.proxy']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.rm.ibm.ll.proxy']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.rm.ibm.pe.proxy']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.rm.slurm.proxy']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.sci']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.utils']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.repo']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.rdt.remotejars']">
+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version>
+ </xsl:template>
+
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="comment()">
+ <xsl:copy/>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/generateModules.xsl b/generateModules.xsl
new file mode 100644
index 0000000..623b39e
--- /dev/null
+++ b/generateModules.xsl
@@ -0,0 +1,30 @@
+<xsl:stylesheet version="2.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:p="http://maven.apache.org/POM/4.0.0"
+ exclude-result-prefixes="p xsi #default">
+
+ <xsl:param name="newVersion"/>
+ <xsl:param name="repo"/>
+
+ <xsl:output encoding="UTF-8" method="xml" indent="yes" />
+
+ <xsl:template match="/p:*">
+ <project name="fixModules" default="fix">
+ <target name="fix">
+ <xsl:template match="p:project">
+ <xsl:for-each select="p:modules/p:module">
+ <xslt style="fixPom.xsl" in="{$repo}/{text()}/pom.xml" out="pom.xml.tmp">
+ <param name="newVersion" expression="{$newVersion}"/>
+ </xslt>
+ <move file="pom.xml.tmp" tofile="{$repo}/{text()}/pom.xml"/>
+ </xsl:for-each>
+ </xsl:template>
+ <xslt style="fixPom.xsl" in="{$repo}/pom.xml" out="pom.xml.tmp">
+ <param name="newVersion" expression="{$newVersion}"/>
+ </xslt>
+ <move file="pom.xml.tmp" tofile="{$repo}/pom.xml"/>
+ </target>
+ </project>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/update_versions b/update_versions
new file mode 100644
index 0000000..e14eecc
--- /dev/null
+++ b/update_versions
@@ -0,0 +1,98 @@
+#!/bin/sh
+#
+# script to update PTP versions
+#
+# Usage: update_versions ptp_version photran_version
+#
+# ptp_version - new version string for PTP (e.g. "5.0.1")
+# photran_version - new version string for Photran (e.g. "7.0.1")
+#
+# Note: a "qualifier" suffix will automatically be added to the version where appropriate
+#
+
+BRANCH=master
+TMP_DIR=/tmp
+
+if [ $# -lt 2 ]; then
+ echo "usage: update_versions ptp_version photran_version"
+ exit 1
+fi
+
+ptp_version=$1
+photran_version=$2
+
+if [ -f fix_ptp_versions ]; then
+ echo "please remove fix_ptp_versions first"
+ exit 1
+fi
+
+mkdir fix_ptp_versions
+cd fix_ptp_versions
+
+git clone git://git.eclipse.org/gitroot/ptp/org.eclipse.photran.git
+(cd org.eclipse.photran && git checkout $BRANCH)
+
+git clone git://git.eclipse.org/gitroot/ptp/org.eclipse.ptp.git
+(cd org.eclipse.ptp && git checkout $BRANCH)
+
+git clone git://git.eclipse.org/gitroot/ptp/org.eclipse.ptp.master.git
+(cd org.eclipse.ptp.master && git checkout $BRANCH)
+
+PTP_PLUGINS="\
+ releng/org.eclipse.ptp.aix.ppc \
+ releng/org.eclipse.ptp.linux.ppc \
+ releng/org.eclipse.ptp.linux.x86 \
+ releng/org.eclipse.ptp.linux.x86_64 \
+ releng/org.eclipse.ptp.macosx.ppc \
+ releng/org.eclipse.ptp.macosx.x86 \
+ releng/org.eclipse.ptp \
+ debug/org.eclipse.ptp.debug.sdm \
+ core/org.eclipse.ptp.utils \
+ core/org.eclipse.ptp.proxy \
+ rms/org.eclipse.ptp.rm.ibm.pe.proxy \
+ rms/org.eclipse.ptp.rm.ibm.ll.proxy \
+ rms/org.eclipse.ptp.rm.slurm.proxy \
+ tools/sci/org.eclipse.ptp.sci \
+ rdt/org.eclipse.ptp.rdt.core.remotejars"
+
+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/^Bundle-Version: *[0-9]\.[0-9]\.[0-9]\.qualifier/Bundle-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 org.eclipse.photran/*-feature; do
+ echo "Updating $feature..."
+ update_feature $feature $photran_version
+done
+
+for feature in org.eclipse.ptp/releng/*-feature; do
+ echo "Updating $feature..."
+ update_feature $feature $ptp_version
+done
+
+for plugin in $PTP_PLUGINS; do
+ echo "Updating $plugin..."
+ update_manifest org.eclipse.ptp/$plugin $ptp_version
+done
+
+(cd org.eclipse.ptp.master && \
+ ant -DnewVersion="$photran_version" -Drepo="../org.eclipse.photran -f fixModules.xml && \
+ ant -DnewVersion="$ptp_version" -Drepo="../org.eclipse.ptp -f fixModules.xml && \
+ ant -DnewVersion="$ptp_version" -Drepo="../org.eclipse.ptp.master -f fixModules.xml)
+
+#(cd org.eclipse.photran && git commit -m "Update PTP & Photran versions" && git push)
+#(cd org.eclipse.ptp && git commit -m "Update PTP & Photran versions" && git push)
+#(cd org.eclipse.ptp.master && git commit -m "Update PTP & Photran versions" && git push)
+
+#
+# Cleanup
+#
+#cd ..
+#rm -rf fix_ptp_versions
+
+exit 0