build submission script simplification
diff --git a/org.eclipse.e4.builder/scripts/bootstrap.sh b/org.eclipse.e4.builder/scripts/bootstrap.sh
index dbecfe7..207bf52 100644
--- a/org.eclipse.e4.builder/scripts/bootstrap.sh
+++ b/org.eclipse.e4.builder/scripts/bootstrap.sh
@@ -1,31 +1,84 @@
 #!/bin/bash
 #
+# must be invoked /bin/bash -l bootstrap.sh ARGS
+#
+
 
 writableBuildRoot=/shared/eclipse/e4
-supportDir=$writableBuildRoot/build/e4
-GIT_CLONES=$supportDir/gitClones
+relengProject=org.eclipse.e4.releng
 relengBranch=master
+buildType=I
+date=$(date +%Y%m%d)
+time=$(date +%H%M)
+timestamp=$date$time
+committerId=pwebster
+gitEmail=pwebster@ca.ibm.com
+gitName="E4 Build"
+basebuilderBranch=R3_7
+eclipsebuilderBranch=R4_HEAD
+eclipseStream=4.2
+e4Stream=0.12
+
 
 while [ $# -gt 0 ]
 do
         case "$1" in
                 "-branch")
                         relengBranch="$2"; shift;;
+                "-eclipseStream")
+                        eclipseStream="$2"; shift;;
+                "-e4Stream")
+                        e4Stream="$2"; shift;;
+                "-buildType")
+                        buildType="$2"; shift;;
+                "-gitCache")
+                        gitCache="$2"; shift;;
+                "-relengProject")
+                        relengProject="$2"; shift;;
+                "-root")
+                        writableBuildRoot="$2"; shift;;
+                "-committerId")
+                        committerId="$2"; shift;;
+                "-gitEmail")
+                        gitEmail="$2"; shift;;
+                "-gitName")
+                        gitName="$2"; shift;;
+                "-basebuilderBranch")
+                        basebuilderBranch="$2"; shift;;
+                "-eclipsebuilderBranch")
+                        eclipsebuilderBranch="$2"; shift;;
+                "-timestamp")
+                        timestamp="$2";
+                        date=${timestamp:0:8}
+                        time=${timestamp:8};
+                        shift;;
                  *) break;;      # terminate while loop
         esac
         shift
 done
 
+supportDir=$writableBuildRoot/build/e4
+if [ -z "$gitCache" ]; then
+	gitCache=$supportDir/gitClones
+fi
 
-cd $GIT_CLONES/org.eclipse.e4.releng
-git checkout $relengBranch
-git pull
-
-
-cp $GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.builder/scripts/masterBuild.sh \
-  $GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.builder/scripts/git-release.sh \
-  $writableBuildRoot
 
 cd $writableBuildRoot
-/bin/bash -l $writableBuildRoot/masterBuild.sh -branch $relengBranch >$writableBuildRoot/logs/current.log 2>&1
+
+wget -O masterBuild.sh http://git.eclipse.org/c/e4/org.eclipse.e4.releng.git/plain/org.eclipse.e4.builder/scripts/masterBuild.sh
+wget -O git-release.sh http://git.eclipse.org/c/e4/org.eclipse.e4.releng.git/plain/org.eclipse.e4.builder/scripts/git-release.sh
+
+/bin/bash "$writableBuildRoot/masterBuild.sh" -branch "$relengBranch" \
+  -relengProject "$relengProject" \
+  -eclipseStream $eclipseStream \
+  -e4Stream $e4Stream \
+  -buildType "$buildType" \
+  -gitCache "$gitCache" \
+  -root "$writableBuildRoot" \
+  -committerId "$committerId" \
+  -gitEmail "$gitEmail" \
+  -gitName "$gitName" \
+  -basebuilderBranch $basebuilderBranch \
+  -eclipsebuilderBranch $eclipsebuilderBranch \
+  -timestamp "$timestamp" >$writableBuildRoot/logs/current.log 2>&1
 
diff --git a/org.eclipse.e4.builder/scripts/git-map.sh b/org.eclipse.e4.builder/scripts/git-map.sh
index 1382bc3..4cce7d1 100644
--- a/org.eclipse.e4.builder/scripts/git-map.sh
+++ b/org.eclipse.e4.builder/scripts/git-map.sh
@@ -4,12 +4,14 @@
 # example usage - you must have your repos checked out on the branch you
 # expect to tag.
 #
-# USAGE: repoRoot relengRoot repoURL [repoURL]*
+# USAGE: repoRoot buildTag relengRoot repoURL [repoURL]*
 #    repoRoot   - absolute path to a folder containing cloned git repositories
+#    buildTag   - build tag to tag all repositories
 #    relengRoot - asolute path to releng project containing map files
 #    repoURL    - git repository urls to tag, must match entries in the map files
 # EXAMPLE: git-map.sh  \
 #   /opt/pwebster/git/eclipse \
+#   I20111122-0800 \
 #   /opt/pwebster/workspaces/gitMigration/org.eclipse.releng \
 #   git://git.eclipse.org/gitroot/platform/eclipse.platform.runtime.git \
 #   git://git.eclipse.org/gitroot/platform/eclipse.platform.ui.git >maps.txt
@@ -20,32 +22,32 @@
 
 PLATFORM=$( uname -s )
 
-get_repo_tag () {
-	REPO=$1
-	REPO_DIR=$( basename $REPO .git )
-	cd $ROOT/$REPO_DIR
-	REPO_COMMIT=$( git rev-list -1 HEAD  )
-	NEW_DATE=$( git log -1 --format="%ct" "$REPO_COMMIT" )
-	if [ "$PLATFORM" == "Darwin" ]; then
-		echo v$( date -u -j -f "%s" "$NEW_DATE" "+%Y%m%d-%H%M" )
-	else
-		echo v$( date -u --date="@$NEW_DATE"  "+%Y%m%d-%H%M" )
-	fi
-}
+writableBuildRoot=/shared/eclipse/e4
+relengProject=org.eclipse.e4.releng
+relengBranch=master
+buildType=I
+date=$(date +%Y%m%d)
+time=$(date +%H%M)
+timestamp=$date$time
+committerId=pwebster
+gitEmail=pwebster@ca.ibm.com
+gitName="E4 Build"
+tag=true
+noTag=false
+
+ARGS="$@"
+
 
 tag_repo_commit () {
 	REPO=$1
 	REPO_DIR=$( basename $REPO .git )
-	NEW_TAG=$( get_repo_tag $REPO )
-	cd $ROOT/$REPO_DIR
+	NEW_TAG=$2
+	pushd "$gitCache/$REPO_DIR" >/dev/null
 	REPO_COMMIT=$( git rev-list -1 HEAD  )
 	if ! ( git log -1  --format="%d" "$REPO_COMMIT" | grep "[ (]$NEW_TAG[,)]" >/dev/null); then
-		OLD_TAG=$( git log --pretty=oneline --decorate | grep "[ (][vI][0-9]" \
-			| head -1 | sed 's/^[^(]* (.*\([vI][0-9][0-9][0-9][0-9]\)/\1/g'   | sed 's/[,)].*$//g' ) 
-		SUBMISSION_ARGS="$SUBMISSION_ARGS $REPO $OLD_TAG $NEW_TAG"
-		echo "#OK Executed: cd $ROOT/$REPO_DIR \; git tag \"$NEW_TAG\" \"$REPO_COMMIT\""
-		cd $ROOT/$REPO_DIR ; git tag "$NEW_TAG" "$REPO_COMMIT"
+		echo "pushd \"$gitCache/$REPO_DIR\" \; git tag \"$NEW_TAG\" \"$REPO_COMMIT\" \; popd"
 	fi
+	popd >/dev/null
 }
 
 update_map () {
@@ -53,7 +55,7 @@
 	REPO=$1
 	REPO_DIR=$( basename $REPO .git )
 	MAP=$2
-	cd $ROOT/$REPO_DIR
+	pushd "$gitCache/$REPO_DIR" >/dev/null
 	grep "repo=${REPO}," "$MAP" >/tmp/maplines_$$.txt
 	if [ ! -s /tmp/maplines_$$.txt ]; then
 		return
@@ -77,45 +79,45 @@
 			fi
 			
 			if ! ( git log -1  --format="%d" "$LAST_COMMIT" | grep "[ (]$NEW_TAG[,)]" >/dev/null); then
-				echo "#OK Executed: cd $ROOT/$REPO_DIR \; git tag \"$NEW_TAG\" \"$LAST_COMMIT\""
-				cd $ROOT/$REPO_DIR ; git tag "$NEW_TAG" "$LAST_COMMIT"
+				echo "pushd \"$gitCache/$REPO_DIR\" \; git tag \"$NEW_TAG\" \"$LAST_COMMIT\" \; popd"
 			fi
-			echo sed "'s/$LINE_START=GIT,tag=$CURRENT_TAG/$LINE_START=GIT,tag=$NEW_TAG/g'" $MAP \>/tmp/t1_$$.txt \; mv /tmp/t1_$$.txt $MAP
+			echo sed "'s/$LINE_START=GIT,tag=$CURRENT_TAG/$LINE_START=GIT,tag=$NEW_TAG/g'" \"$MAP\" \>/tmp/t1_$$.txt \; mv /tmp/t1_$$.txt \"$MAP\"
 		else
 			echo OK $LINE_START $CURRENT_TAG 
 		fi
 	done </tmp/maplines_$$.txt
 	rm -f /tmp/maplines_$$.txt
-	echo \( cd $ROOT/$REPO_DIR \; git push --tags \)
+	popd >/dev/null
 }
 
 
 STATUS=OK
 STATUS_MSG=""
 LATEST_SUBMISSION=""
-SUBMISSION_ARGS=""
 
-if [ $# -lt 3 ]; then
-  echo "USAGE: $0 repoRoot relengRoot repoURL [repoURL]*"
+
+if [ $# -lt 4 ]; then
+  echo "USAGE: $0 repoRoot buildTag relengRoot repoURL [repoURL]*"
   exit 1
 fi
 
 
-ROOT=$1; shift
+gitCache=$1; shift
+buildTag=$1; shift
 RELENG=$1; shift
 REPOS="$@"
 
 
-
+cd $gitCache
 for REPO in $REPOS; do
-	cd $ROOT
-	tag_repo_commit $REPO
+	tag_repo_commit $REPO $buildTag
 	MAPS=$( find $RELENG -name "*.map" -exec grep -l "repo=${REPO}," {} \; )
 	if [ ! -z "$MAPS" ]; then
 		for MAP in $MAPS; do
 			update_map $REPO $MAP
 		done
 	fi
+	REPO_DIR=$( basename $REPO .git )
+	echo  pushd \"$gitCache/$REPO_DIR\" \; git push --tags \; popd 
 done
 
-echo "/bin/bash git-submission.sh $ROOT $SUBMISSION_ARGS > report.txt"
diff --git a/org.eclipse.e4.builder/scripts/git-release.sh b/org.eclipse.e4.builder/scripts/git-release.sh
index 00aaf01..ac51196 100644
--- a/org.eclipse.e4.builder/scripts/git-release.sh
+++ b/org.eclipse.e4.builder/scripts/git-release.sh
@@ -12,95 +12,122 @@
 #*******************************************************************************
 
 #default values, overridden by command line
-user=pwebster
-email=pwebster@ca.ibm.com
-name="E4 Build"
 writableBuildRoot=/shared/eclipse/e4
-supportDir=$writableBuildRoot/build/e4
-GIT_CLONES=$supportDir/gitClones
+relengProject=org.eclipse.e4.releng
+relengBranch=master
 buildType=I
 date=$(date +%Y%m%d)
 time=$(date +%H%M)
 timestamp=$date$time
-relengBranch=master
+committerId=pwebster
+gitEmail=pwebster@ca.ibm.com
+gitName="E4 Build"
+tag=true
+noTag=false
+
+ARGS="$@"
 
 while [ $# -gt 0 ]
 do
         case "$1" in
                 "-branch")
                         relengBranch="$2"; shift;;
-
-                "-I")
-                        buildType=I;
-                        tagMaps="-DtagMaps=true";
-                        compareMaps="-DcompareMaps=true";;
-                "-N")
-                        buildType=N;
-                        tagMaps="";
-                        compareMaps="";
-                        fetchTag="-DfetchTag=CVS=HEAD,GIT=origin/master";;
-
+                "-buildType")
+                        buildType="$2"; shift;;
+                "-gitCache")
+                        gitCache="$2"; shift;;
+                "-relengProject")
+                        relengProject="$2"; shift;;
                 "-root")
                         writableBuildRoot="$2"; shift;;
-
+                "-committerId")
+                        committerId="$2"; shift;;
+                "-gitEmail")
+                        gitEmail="$2"; shift;;
+                "-gitName")
+                        gitName="$2"; shift;;
+                "-oldBuildTag")
+                        oldBuildTag="$2"; shift;;
+                "-buildTag")
+                        buildTag="$2"; shift;;
+                "-basebuilderBranch")
+                        basebuilderBranch="$2"; shift;;
+                "-eclipsebuilderBranch")
+                        eclipsebuilderBranch="$2"; shift;;
+                "-tag")
+                        tag="$2"; shift;;
                 "-timestamp")
                         timestamp="$2";
                         date=${timestamp:0:8}
                         time=${timestamp:8};
                         shift;;
-
-                "-noTag")
-                        noTag=true;;
-
-                -*)
-                        echo >&2 usage: $0 [-I | -N]
-                        exit 1;;
                  *) break;;      # terminate while loop
         esac
         shift
 done
 
+if [ -z "$oldBuildTag"  ]; then
+  echo You must provide -oldBuildTag
+  echo args: "$ARGS"
+  exit
+fi
+
+if ! $tag; then
+	noTag=true
+fi
+
+supportDir=$writableBuildRoot/build/e4
+if [ -z "$gitCache" ]; then
+	gitCache=$supportDir/gitClones
+fi
+
+if [ -z "$buildTag" ]; then
+	buildTag=$buildType${date}-${time}
+fi
+
 #Pull or clone a branch from a repository
 #Usage: pull repositoryURL  branch
 pull() {
-        pushd $GIT_CLONES
+        pushd $gitCache
         directory=$(basename $1 .git)
         if [ ! -d $directory ]; then
                 echo git clone $1
                 git clone $1
                 cd $directory
-                git config --add user.email "$email"
-                git config --add user.name "$name"
+                git config --add user.email "$gitEmail"
+                git config --add user.name "$gitName"
         fi
         popd
-        pushd $GIT_CLONES/$directory
+        pushd $gitCache/$directory
         echo git checkout $2
         git checkout $2
         echo git pull
         git pull
         popd
 }
+
 #Nothing to do for nightly builds, or if $noTag is specified
-if [ "$buildType" == "N" -o "$noTag" ]; then
-        echo Skipping build tagging for nightly build or -noTag build
+if $noTag || [ "$buildType" == "N" ]; then
+        echo Skipping build tagging for nightly build or -tag false build
         exit
 fi
 
 pushd $writableBuildRoot
-relengRepo=$GIT_CLONES/org.eclipse.e4.releng
-#pull the releng project to get the list of repositories to tag
-pull "ssh://$user@git.eclipse.org/gitroot/e4/org.eclipse.e4.releng.git" $relengBranch
+relengRepo=$gitCache/${relengProject}
+# pull the releng project to get the list of repositories to tag
+pull "ssh://$committerId@git.eclipse.org/gitroot/e4/org.eclipse.e4.releng.git" $relengBranch
 
-cp $relengRepo/org.eclipse.e4.builder/scripts/git-map.sh .
-chmod 744 git-map.sh
-cp $relengRepo/org.eclipse.e4.builder/scripts/git-submission.sh .
-chmod 744 git-submission.sh
+wget -O git-map.sh http://git.eclipse.org/c/e4/org.eclipse.e4.releng.git/plain/org.eclipse.e4.builder/scripts/git-map.sh
+wget -O git-submission.sh http://git.eclipse.org/c/e4/org.eclipse.e4.releng.git/plain/org.eclipse.e4.builder/scripts/git-submission.sh
+#cp /opt/pwebster/git/R42/org.eclipse.e4.releng/org.eclipse.e4.builder/scripts/git-map.sh .
+#cp /opt/pwebster/git/R42/org.eclipse.e4.releng/org.eclipse.e4.builder/scripts/git-submission.sh .
 
 
 #remove comments
-rm -f repos-clean.txt clones.txt
+rm -f repos-clean.txt clones.txt repos-report.txt
+
 cat "$relengRepo/tagging/repositories.txt" | grep -v "^#" > repos-clean.txt
-#clone or pull each repository and checkout the appropriate branch
+# clone or pull each repository and checkout the appropriate branch
 while read line; do
         #each line is of the form <repository> <branch>
         set -- $line
@@ -108,20 +135,26 @@
         echo $1 | sed 's/ssh:.*@git.eclipse.org/git:\/\/git.eclipse.org/g' >> clones.txt
 done < repos-clean.txt
 
-cat clones.txt| xargs /bin/bash git-map.sh $GIT_CLONES \
+cat repos-clean.txt | sed "s/ / $oldBuildTag /" >repos-report.txt
+
+# generate the change report
+mkdir $writableBuildRoot/$buildTag
+echo "[git-release]" git-submission.sh $gitCache $( cat repos-report.txt )
+/bin/bash git-submission.sh $gitCache $( cat repos-report.txt ) > $writableBuildRoot/$buildTag/report.txt
+
+
+cat clones.txt| xargs /bin/bash git-map.sh $gitCache $buildTag \
         $relengRepo > maps.txt
 
 #Trim out lines that don't require execution
 grep -v ^OK maps.txt | grep -v ^Executed >run.txt
 /bin/bash run.txt
 
-mkdir $writableBuildRoot/$buildType$timestamp
-cp report.txt $writableBuildRoot/$buildType$timestamp
 
 cd $relengRepo
 git add $( find . -name "*.map" )
-git commit -m "Releng build tagging for $buildType$timestamp"
-git tag -f $buildType$timestamp   #tag the map file change
+git commit -m "Releng build tagging for $buildTag"
+git tag -f $buildTag   #tag the map file change
 
 git push
 git push --tags
diff --git a/org.eclipse.e4.builder/scripts/git-submission.sh b/org.eclipse.e4.builder/scripts/git-submission.sh
index ceef8c3..a75ba0f 100644
--- a/org.eclipse.e4.builder/scripts/git-submission.sh
+++ b/org.eclipse.e4.builder/scripts/git-submission.sh
@@ -7,7 +7,7 @@
 
 
 ROOT=$1; shift
-rm -f /tmp/proj_changed_$$.txt /tmp/bug_list_$$.txt
+rm -f /tmp/proj_changed_$$.txt /tmp/bug_list_$$.txt /tmp/bug_info_$$.txt
 
 while [ $# -gt 0 ]; do
 	REPO="$1"; shift
@@ -23,7 +23,7 @@
 		| sed 's/.*[Bb]ug[^0-9]*\([0-9][0-9][0-9][0-9][0-9]*\)[^0-9].*$/\1/g' >>/tmp/bug_list_$$.txt
 done
 
-rm -f /tmp/bug_info_$$.txt
+touch /tmp/bug_info_$$.txt
 
 for BUG in $( cat /tmp/bug_list_$$.txt | sort -n -u ); do
 	BUGT2=/tmp/buginfo_${BUG}_$$.txt
diff --git a/org.eclipse.e4.builder/scripts/masterBuild.sh b/org.eclipse.e4.builder/scripts/masterBuild.sh
index 102de1b..9b684e5 100755
--- a/org.eclipse.e4.builder/scripts/masterBuild.sh
+++ b/org.eclipse.e4.builder/scripts/masterBuild.sh
@@ -1,17 +1,23 @@
 #!/bin/bash +x
 
 #default values, overridden by command line
-user=pwebster
-email=pwebster@ca.ibm.com
-name="E4 Build"
 writableBuildRoot=/shared/eclipse/e4
-supportDir=$writableBuildRoot/build/e4
-GIT_CLONES=$supportDir/gitClones
+relengProject=org.eclipse.e4.releng
+relengBranch=master
+buildType=I
+date=$(date +%Y%m%d)
+time=$(date +%H%M)
+timestamp=$date$time
+committerId=pwebster
+gitEmail=pwebster@ca.ibm.com
+gitName="E4 Build"
+
+eclipseStream=4.2
+e4Stream=0.12
+basebuilderBranch=R3_7
+eclipsebuilderBranch=R4_HEAD
 
 quietCVS=-Q
-publishingUser=pwebster
-writableBuildRoot=/shared/eclipse/e4
-relengBranch="master"; # default set below
 arch="x86_64"
 archProp="-x86_64"
 processor=$( uname -p )
@@ -21,84 +27,103 @@
     arch="ppc"
 fi
 
+#
+#  control various aspects of the build
+#
+
+publish=true
+tag=true
+
+
 
 while [ $# -gt 0 ]
 do
         case "$1" in
                 "-branch")
                         relengBranch="$2"; shift;;
+                "-eclipseStream")
+                        eclipseStream="$2"; shift;;
+                "-e4Stream")
+                        e4Stream="$2"; shift;;
+                "-buildType")
+                        buildType="$2"; shift;;
+                "-gitCache")
+                        gitCache="$2"; shift;;
+                "-relengProject")
+                        relengProject="$2"; shift;;
+                "-root")
+                        writableBuildRoot="$2"; shift;;
+                "-committerId")
+                        committerId="$2"; shift;;
+                "-gitEmail")
+                        gitEmail="$2"; shift;;
+                "-gitName")
+                        gitName="$2"; shift;;
+                "-basebuilderBranch")
+                        basebuilderBranch="$2"; shift;;
+                "-eclipsebuilderBranch")
+                        eclipsebuilderBranch="$2"; shift;;
+                "-timestamp")
+                        timestamp="$2";
+                        date=${timestamp:0:8}
+                        time=${timestamp:8};
+                        shift;;
                  *) break;;      # terminate while loop
         esac
         shift
 done
 
+supportDir=$writableBuildRoot/build/e4
+if [ -z "$gitCache" ]; then
+	gitCache=$supportDir/gitClones
+fi
 
 
-#
-# Real Build on build.eclipse.org
-#
-realBuildProperties () {
-	supportDir=$writableBuildRoot/build/e4
-	GIT_CLONES=$supportDir/gitClones
-	builderDir=${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.builder
-    builddate=$( date +%Y%m%d )
-    buildtime=$( date +%H%M )
+builderDir=${gitCache}/${relengProject}/org.eclipse.e4.builder
 
+if [ "$buildType" = N ]; then
+	tag=false
+fi
 
 #publish
-    publishIndex="$publishingUser@build.eclipse.org:/home/data/httpd/download.eclipse.org/e4/downloads"
-    publishSDKIndex="$publishingUser@build.eclipse.org:/home/data/httpd/download.eclipse.org/eclipse/downloads"
-    publishUpdates="$publishingUser@build.eclipse.org:/home/data/httpd/download.eclipse.org/e4/updates"
-    publishDir="${publishIndex}/drops"
+publishIndex="${committerId}@build.eclipse.org:/home/data/httpd/download.eclipse.org/e4/downloads"
+publishSDKIndex="${committerId}@build.eclipse.org:/home/data/httpd/download.eclipse.org/eclipse/downloads"
+publishUpdates="${committerId}@build.eclipse.org:/home/data/httpd/download.eclipse.org/e4/updates"
+publishDir="${publishIndex}/drops"
 
-# available builds
-    #basebuilderBranch=$( grep v2009 /cvsroot/eclipse/org.eclipse.releng.basebuilder/about.html,v | head -1 | cut -f1 -d: | tr -d "[:blank:]" )
-    #eclipseIBuild=$( ls -d /home/data/httpd/download.eclipse.org/eclipse/downloads/drops/I*/eclipse-SDK-I*-linux-gtk${archProp}.tar.gz | tail -1 | cut -d/ -f9 )
-    basebuilderBranch=R3_7
-}
+oldBuildTag=$( cat $writableBuildRoot/${buildType}build.properties )
+echo "Last build: $oldBuildTag"
+echo $buildTag >$writableBuildRoot/${buildType}build.properties
 
 
-#
-# test Build
-#
-testBuildProperties () {
-	supportDir=$writableBuildRoot/build/e4
-	GIT_CLONES=$supportDir/gitClones
-	builderDir=${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.builder
-	noTag=true
 
-#	builderDir=/opt/pwebster/workspaces/e4/releng/org.eclipse.e4.builder
-#builddate=20090624
-#buildtime=1012
-    builddate=$( date +%Y%m%d )
-    buildtime=$( date +%H%M )
 
-    projRoot=':pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse'
-    basebuilderBranch=R3_7
-}
 
-commonProperties () {
-    javaHome=/opt/public/common/sun-jdk1.6.0_21_x64
-    buildTimestamp=${builddate}-${buildtime}
-    buildDir=$writableBuildRoot/build/e4/downloads/drops/4.0.0
-    targetDir=${buildDir}/targets
-    targetZips=$targetDir/downloads
-    transformedRepo=${targetDir}/helios-p2
-    buildDirectory=$buildDir/I$buildTimestamp
+# common properties
+
+javaHome=/opt/public/common/sun-jdk1.6.0_21_x64
+buildTimestamp=${date}-${time}
+buildTag=$buildType$buildTimestamp
+
+buildDir=$writableBuildRoot/build/e4/downloads/drops/4.0.0
+targetDir=${buildDir}/targets
+targetZips=$targetDir/downloads
+transformedRepo=${targetDir}/helios-p2
+buildDirectory=$buildDir/$buildTag
     
-    e4TestDir=/opt/buildhomes/e4Build/e4Tests/I$buildTimestamp
-    sdkTestDir=/opt/buildhomes/e4Build/sdkTests/I$buildTimestamp
+e4TestDir=/opt/buildhomes/e4Build/e4Tests/$buildTag
+sdkTestDir=/opt/buildhomes/e4Build/sdkTests/$buildTag
     
-    buildResults=$buildDirectory/I$buildTimestamp
+buildResults=$buildDirectory/$buildTag
     
-    sdkResults=$buildDir/40builds/I$buildTimestamp/I$buildTimestamp
-    sdkBuildDirectory=$buildDir/40builds/I$buildTimestamp
+sdkResults=$buildDir/40builds/$buildTag/$buildTag
+sdkBuildDirectory=$buildDir/40builds/$buildTag
 		
-    relengBaseBuilderDir=$supportDir/org.eclipse.releng.basebuilder
-    buildDirEclipse="$buildDir/eclipse"
-    WORKSPACE="$buildDir/workspace"
-    export WORKSPACE
-}
+relengBaseBuilderDir=$supportDir/org.eclipse.releng.basebuilder
+buildDirEclipse="$buildDir/eclipse"
+WORKSPACE="$buildDir/workspace"
+export WORKSPACE
+
 
 # first, let's check out all of those pesky projects
 updateBaseBuilder () {
@@ -127,38 +152,47 @@
 }
 
 updateE4Builder () {
+    echo "[updateE4Builder]" cd ${gitCache}/${relengProject}
+    echo "[updateE4Builder]" git checkout ${relengBranch}
+    cd ${gitCache}/${relengProject}
+    git checkout ${relengBranch}
+    git pull
+    
     cd $supportDir
 
     echo "[start] [`date +%H\:%M\:%S`] setting org.eclipse.e4.builder_${relengBranch}"
     rm org.eclipse.e4.builder
-    ln -s ${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.builder org.eclipse.e4.builder
+    ln -s ${gitCache}/${relengProject}/org.eclipse.e4.builder org.eclipse.e4.builder
 
-}
-
-updateSDKBuilder () {
-    cd $supportDir
-    
     echo "[start] [`date +%H\:%M\:%S`] setting org.eclipse.e4.sdk_${relengBranch}"
     rm org.eclipse.e4.sdk 
-    ln -s ${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.sdk org.eclipse.e4.sdk  
+    ln -s ${gitCache}/${relengProject}/org.eclipse.e4.sdk org.eclipse.e4.sdk  
 }
 
+
 updateEclipseBuilder() {
 	cd $supportDir
 	echo "[`date +%H\:%M\:%S`] get org.eclipse.releng.eclipsebuilder"
-    if [[ ! -d org.eclipse.releng.eclipsebuilder_R4_HEAD ]]; then
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS co -r R4_HEAD -d org.eclipse.releng.eclipsebuilder_R4_HEAD org.eclipse.releng.eclipsebuilder"
+    if [[ ! -d org.eclipse.releng.eclipsebuilder_${eclipsebuilderBranch} ]]; then
+        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS co -r $eclipsebuilderBranch -d org.eclipse.releng.eclipsebuilder_${eclipsebuilderBranch} org.eclipse.releng.eclipsebuilder"
         echo $cmd
         $cmd
     else
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS update -C -d org.eclipse.releng.eclipsebuilder_R4_HEAD "
+        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS update -C -d org.eclipse.releng.eclipsebuilder_${eclipsebuilderBranch} "
         echo $cmd
         $cmd
     fi
     
-    echo "[`date +%H\:%M\:%S`] setting org.eclipse.e4.builder_R4_HEAD"
+    echo "[`date +%H\:%M\:%S`] setting org.eclipse.e4.builder_${eclipsebuilderBranch}"
     rm org.eclipse.releng.eclipsebuilder
-    ln -s ${supportDir}/org.eclipse.releng.eclipsebuilder_R4_HEAD org.eclipse.releng.eclipsebuilder
+    ln -s ${supportDir}/org.eclipse.releng.eclipsebuilder_${eclipsebuilderBranch} org.eclipse.releng.eclipsebuilder
+}
+
+sync_sdk_updates () {
+	fromDir=$targetDir/updates/${eclipseStream}-I-builds
+	toDir="pwebster@build.eclipse.org:/home/data/httpd/download.eclipse.org/eclipse/updates"
+
+	rsync --recursive --delete "${fromDir}" "${toDir}"
 }
 
 runSDKBuild () {
@@ -174,14 +208,14 @@
       -cp $cpAndMain \
       -application org.eclipse.ant.core.antRunner  \
       -buildfile $buildfile \
-	  -Dbuilder=$GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.sdk/builder \
-	  -Dorg.eclipse.e4.builder=$GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.builder \
+	  -Dbuilder=$gitCache/${relengProject}/org.eclipse.e4.sdk/builder \
+	  -Dorg.eclipse.e4.builder=$gitCache/${relengProject}/org.eclipse.e4.builder \
 	  -Declipse.build.configs=$supportDir/org.eclipse.releng.eclipsebuilder/eclipse/buildConfigs \
-	  -DbuildType=I \
+	  -DbuildType=$buildType \
 	  -Dbuilddate=$builddate \
 	  -Dbuildtime=$buildtime \
 	  -Dbase=$buildDir/40builds \
-	  -DupdateSite=$targetDir/updates/4.2-I-builds
+	  -DupdateSite=$targetDir/updates/${eclipseStream}-I-builds
 	"   
     echo $cmd
     $cmd  
@@ -202,7 +236,7 @@
 			prereqMsg=`cat $buildDirectory/prereqErrors.log` 
 		fi
 		
-		mailx -s "4.2 SDK Build: $buildId failed" e4-dev@eclipse.org <<EOF
+		mailx -s "$eclipseStream SDK Build: $buildTag failed" e4-dev@eclipse.org <<EOF
 $compileMsg
 $compileProblems
 
@@ -213,10 +247,121 @@
 		exit
 	fi 
       
-	/bin/bash ${builderDir}/scripts/sync.sh
+	sync_sdk_updates
+}
+
+process_build () {
+	buildId=$1 ; shift
+	echo Processing $BASE_DIR/$buildId/$buildId
 	
-	#Done at the end of runSDKTests()
-	#/bin/bash ${builderDir}/scripts/publish.sh
+	if [ -e $BASE_DIR/$buildId ]; then
+	return;
+	fi
+	
+	mkdir -p $BASE_DIR/$buildId
+	
+	cd $TMPL_DIR
+	cp *.php *.htm*  *.gif *.jpg  $BASE_DIR/$buildId
+	
+	cd $HUDSON_DROPS/$buildId/$buildId
+	
+	cp *.htm*  $BASE_DIR/$buildId
+	cp -r results $BASE_DIR/$buildId
+	
+	ZIPS=$( echo $ORIG_ZIPS | sed "s/ReplaceMe/$buildId/g" )
+	for f in $ZIPS; do
+	echo $f
+	cp $f  $BASE_DIR/$buildId
+	done
+	
+	cp -fr *repository.zip buildlogs checksum compilelogs $BASE_DIR/$buildId
+	#cp -r $HUDSON_REPO/$buildId  $BASE_DIR/$buildId/repository
+	
+	cp  $TMPL_DIR/download.php  $BASE_DIR/$buildId
+	
+	for f in $( echo $FILES_TO_UPDATE ); do
+	cat $TMPL_DIR/$f | sed "s/ReplaceMe/$buildId/g" >$BASE_DIR/$buildId/$f
+	done
+	
+	scp -r $BASE_DIR/$buildId pwebster@build.eclipse.org:/home/data/httpd/download.eclipse.org/eclipse/downloads/drops4
+	
+
+	echo Done $buildId
+
+	failed=""
+	testsMsg=$(sed -n '/<!--START-TESTS-->/,/<!--END-TESTS-->/p' $HUDSON_DROPS/$buildId/$buildId/results/testResults.html > mail.txt)
+	testsMsg=$(cat mail.txt | sed s_href=\"_href=\"http://download.eclipse.org/eclipse/downloads/drops4/$buildId/results/_)
+	rm mail.txt
+	
+	red=$(echo $testsMsg | grep "color:red")
+    if [[ ! -z $red ]]; then
+		failed="tests failed"
+    fi
+ 
+(
+echo "From: e4Build@build.eclipse.org "
+echo "To: e4-dev@eclipse.org "
+echo "MIME-Version: 1.0 "
+echo "Content-Type: text/html; charset=us-ascii"
+echo "Subject: $eclipseStream SDK Build: $buildId $failed"
+echo ""
+echo "<html><head><title>$eclipseStream SDK Build $buildId</title></head>" 
+echo "<body>Check here for the build results: <a href="http://download.eclipse.org/eclipse/downloads/drops4/$buildId">$buildId</a><br>" 
+echo "$testsMsg</body></html>" 
+) | /usr/lib/sendmail -t
+   
+}
+
+publish_sdk () {
+
+BASE_DIR=/shared/eclipse/e4/sdk
+TMPL_DIR=$BASE_DIR/template
+
+ORIG_ZIPS="
+eclipse-SDK-ReplaceMe-linux-gtk-ppc64.tar.gz
+eclipse-SDK-ReplaceMe-linux-gtk.tar.gz
+eclipse-SDK-ReplaceMe-linux-gtk-x86_64.tar.gz
+eclipse-SDK-ReplaceMe-macosx-cocoa.tar.gz
+eclipse-SDK-ReplaceMe-macosx-cocoa-x86_64.tar.gz
+eclipse-SDK-ReplaceMe-win32-x86_64.zip
+eclipse-SDK-ReplaceMe-win32.zip
+eclipse-SDK-ReplaceMe-aix-gtk-ppc.zip
+eclipse-SDK-ReplaceMe-aix-gtk-ppc64.zip
+eclipse-SDK-ReplaceMe-hpux-gtk-ia64_32.zip
+eclipse-SDK-ReplaceMe-solaris-gtk.zip
+eclipse-SDK-ReplaceMe-solaris-gtk-x86.zip
+"
+
+FILES_TO_UPDATE="
+linPlatform.php
+macPlatform.php
+sourceBuilds.php
+winPlatform.php
+index.php
+"
+
+HUDSON_COMMON=/shared/eclipse/e4/build/e4/downloads/drops/4.0.0/40builds
+HUDSON_DROPS=$HUDSON_COMMON
+HUDSON_REPO=$targetDir/updates/${eclipseStream}-I-builds
+
+
+
+# find the builds to process
+
+BUILDS=$( ls -d $HUDSON_DROPS/I* | cut -d/ -f11 )
+
+if [ -z "$BUILDS" -o  "$BUILDS" = "I*" ]; then
+	return
+fi
+
+for f in $BUILDS; do
+process_build $f
+done
+
+cd $TMPL_DIR
+
+wget -O index.txt http://download.eclipse.org/eclipse/downloads/createIndex4x.php
+scp index.txt pwebster@build.eclipse.org:/home/data/httpd/download.eclipse.org/eclipse/downloads/index.html
 }
 
 runSDKTests() {
@@ -231,9 +376,9 @@
 
 	echo "sdkResults=$sdkResults" >> label.properties
 	echo "e4Results=$buildResults" >> label.properties
-	echo "buildType=I" >> label.properties
-	echo "sdkRepositoryRoot=$targetDir/updates/4.2-I-builds" >> label.properties
-	echo "e4RepositoryRoot=$targetDir/updates/0.12-I-builds" >> label.properties
+	echo "buildType=$buildType" >> label.properties
+	echo "sdkRepositoryRoot=$targetDir/updates/${eclipseStream}-I-builds" >> label.properties
+	echo "e4RepositoryRoot=$targetDir/updates/${e4Stream}-I-builds" >> label.properties
 
 	echo "Copying test framework."
     cp -r ${builderDir}/builder/general/tests/* .
@@ -246,7 +391,7 @@
 	cd $sdkBuildDirectory
 	mv $sdkTestDir $sdkBuildDirectory/eclipse-testing
     
-    /bin/bash ${builderDir}/scripts/publish.sh
+    publish_sdk
 }
 
 copyCompileLogs () {
@@ -320,9 +465,9 @@
 
 	echo "sdkResults=$sdkResults" >> label.properties
 	echo "e4Results=$buildResults" >> label.properties
-	echo "buildType=I" >> label.properties
-	echo "sdkRepositoryRoot=$targetDir/updates/4.2-I-builds" >> label.properties
-	echo "e4RepositoryRoot=$targetDir/updates/0.12-I-builds" >> label.properties
+	echo "buildType=$buildType" >> label.properties
+	echo "sdkRepositoryRoot=$targetDir/updates/${eclipseStream}-I-builds" >> label.properties
+	echo "e4RepositoryRoot=$targetDir/updates/${e4Stream}-I-builds" >> label.properties
 
 	echo "Copying test framework."
     cp -r ${builderDir}/builder/general/tests/* .
@@ -344,7 +489,7 @@
 sendMail () {
 	failed=""
 	testsMsg=$(sed -n '/<!--START-TESTS-->/,/<!--END-TESTS-->/p' $buildResults/results/testResults.html > mail.txt)
-	testsMsg=$(cat mail.txt | sed s_href=\"_href=\"http://download.eclipse.org/e4/downloads/drops/I$buildTimestamp/results/_)
+	testsMsg=$(cat mail.txt | sed s_href=\"_href=\"http://download.eclipse.org/e4/downloads/drops/$buildTag/results/_)
 	rm mail.txt
 	
 	red=$(echo $testsMsg | grep "color:red")
@@ -357,10 +502,10 @@
 echo "To: e4-dev@eclipse.org "
 echo "MIME-Version: 1.0 "
 echo "Content-Type: text/html; charset=us-ascii"
-echo "Subject: 0.12 Integration Build: I$buildTimestamp $failed"
+echo "Subject: $e4Stream Integration Build: $buildTag $failed"
 echo ""
-echo "<html><head><title>0.12 Integration Build: I$buildTimestamp $failed</title></head>" 
-echo "<body>Check here for the build results: <a href="http://download.eclipse.org/e4/downloads/drops/I$buildTimestamp">I$buildTimestamp</a><br><br>" 
+echo "<html><head><title>$e4Stream Integration Build: $buildTag $failed</title></head>" 
+echo "<body>Check here for the build results: <a href="http://download.eclipse.org/e4/downloads/drops/$buildTag">$buildTag</a><br><br>" 
 echo "$testsMsg</body></html>" 
 ) | /usr/lib/sendmail -t
 
@@ -383,20 +528,12 @@
       -DbuildDirectory=$buildDirectory \
       -Dbase.builder=$relengBaseBuilderDir \
       -Dbase.builder.launcher=$cpLaunch \
-      -DmapsRepo=$projRoot \
       -DlogExtension=.xml \
       -Djava15-home=$javaHome \
       -DrunPackager=true -Dgenerate.p2.metadata=true -Dp2.publish.artifacts=true \
       -DtopLevelElementId=org.eclipse.e4.master \
       -Dflex.sdk=$writableBuildRoot/flex_sdk_3.2.0.3794_mpl "
   
-    if [ ! -z "$tagMaps" ]; then
-        cmd="$cmd -DtagMaps=true "
-    fi
-    #if [ ! -z "$genRepo" ]; then
-    #    cmd="$cmd -DrunPackager=true -Dgenerate.p2.metadata=true -Dp2.publish.artifacts=true "
-    #fi
-
     echo $cmd
     $cmd
 
@@ -431,21 +568,23 @@
     cp tmp.txt org.eclipse.swt/META-INF/MANIFEST.MF
     swtExport org.eclipse.swt.e4.jcl
     cp org.eclipse.swt.e4.jcl/.classpath_flex org.eclipse.swt.e4.jcl/.classpath
-    zip -r ../I$buildTimestamp/org.eclipse.swt.e4.flex-incubation-I$buildTimestamp.zip org.eclipse.swt org.eclipse.swt.e4.jcl
+    zip -r ../$buildTag/org.eclipse.swt.e4.flex-incubation-$buildTag.zip org.eclipse.swt org.eclipse.swt.e4.jcl
 }
 
 tagRepo () {
 	pushd $writableBuildRoot
-	/bin/bash git-release.sh -branch $relengBranch -timestamp $builddate$buildtime
+	/bin/bash git-release.sh -branch "$relengBranch" \
+   -relengProject "$relengProject" \
+   -buildType "$buildType" -gitCache "$gitCache" -root "$writableBuildRoot" \
+   -committerId "$committerId" -gitEmail "$gitEmail" -gitName "$gitName" \
+   -timestamp "$timestamp" -oldBuildTag $oldBuildTag -buildTag $buildTag \
+   -tag $tag
 	popd
+	mailx -s "$eclipseStream SDK Build: $buildTag submission" e4-dev@eclipse.org <$writableBuildRoot/$buildTag/report.txt
 }
 
-realBuildProperties
-#testBuildProperties
-commonProperties
 updateBaseBuilder
 updateBaseBuilderInfo
-updateSDKBuilder
 updateE4Builder
 updateEclipseBuilder
 
@@ -471,14 +610,15 @@
 runSDKTests
 runTheTests e4less
 
-cp /shared/eclipse/e4/logs/current.log \
+cp $writableBuildRoot/logs/current.log \
+	$writableBuildRoot/$buildTag/report.txt \
     $buildResults/buildlog.txt
 
 
-if [ ! -z "$publishDir" ]; then
+if $publish && [ ! -z "$publishDir"  ]; then
     echo Publishing  $buildResults to "$publishDir"
     scp -r $buildResults "$publishDir"
-    rsync --recursive --delete ${targetDir}/updates/0.12-I-builds \
+    rsync --recursive --delete ${targetDir}/updates/${e4Stream}-I-builds \
       "${publishUpdates}"
     sendMail
     sleep 60