Releng: improve createRepository
+ revise parameter passing between runtests & createRepo
+ remove obsolete DO_BUILD
+ remove obsolete cleaning from previous build (we have no workspace)
+ extractVersions: improve version computation
diff --git a/releng/build-scripts/bin/createRepository-hipp.sh b/releng/build-scripts/bin/createRepository-hipp.sh
index 7bfdfa4..b644575 100755
--- a/releng/build-scripts/bin/createRepository-hipp.sh
+++ b/releng/build-scripts/bin/createRepository-hipp.sh
@@ -7,7 +7,10 @@
 BASE=`pwd`
 
 # ABSOLUTE PATHS:
-export UPDATES_BASE=genie.objectteams@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/objectteams/updates
+TARGET_HOST=genie.objectteams@projects-storage.eclipse.org
+TARGET_BASEDIR=/home/data/httpd/download.eclipse.org/objectteams/updates
+TARGET_HTTPS="https://download.eclipse.org/objectteams/updates"
+export UPDATES_BASE=${TARGET_HOST}:${TARGET_BASEDIR}
 export JAVA8=/opt/tools/java/oracle/jdk-8/latest/bin/java
 export JAVA11=/opt/tools/java/openjdk/jdk-11/latest/bin/java
 
@@ -21,7 +24,8 @@
         MASTER="none"
         echo "Generating fresh new repository"
 else
-# FIXME : this branch is broken
+		echo "Using a previous repo is broken in this script"
+		exit 1
         MASTER=${UPDATES_BASE}/$1
         if [ -r ${MASTER}/features ]
         then
@@ -33,7 +37,7 @@
                 echo "Generating Repository based on ${MASTER}"
             else
                 echo "No such repository ${MASTER}"
-                echo "Usage: $0 updateMasterRelativePath [ -nosign ] [ statsRepoId statsVersionId ]"
+                echo "Usage: $0 updateMasterRelativePath [ statsRepoId statsVersionId ]"
                 exit 1
             fi
         fi
@@ -63,6 +67,7 @@
                 JDTVERSIONC1=`echo ${JDTVERSIONA} | cut -d 'v' -f 1`
                 JDTVERSIONC2=`echo ${JDTVERSIONA} | cut -d 'v' -f 2`
                 JDTVERSIONC3=`expr $JDTVERSIONC2 + 1`
+                JDTVERSIONC3=`printf "%04d" ${JDTVERSIONC3}`
                 JDTVERSION=${JDTVERSIONC1}v${JDTVERSIONC2}
                 JDTVERSIONNEXT=${JDTVERSIONC1}v${JDTVERSIONC3}
                 ;;
@@ -107,8 +112,9 @@
 
 for dir in features plugins
 do
+		# add "-verbose" to the second line if needed:
         find ${BASE}/testrun/updateSite/${dir} -type f -name \*.jar -exec \
-                ${JAVA8} -jar ${JARPROCESSOR} -verbose -processAll -repack -outputDir ${CONDITIONED}/${dir} {} \;
+                ${JAVA8} -jar ${JARPROCESSOR} -processAll -repack -outputDir ${CONDITIONED}/${dir} {} \;
 done
 # not conditioned, but must not be skipped!
 cp ${BASE}/testrun/updateSite/plugins/org.eclipse.jdt.core_* ${CONDITIONED}/plugins/
@@ -176,8 +182,9 @@
 echo "====Step 3: pack jars (again) ===="
 for dir in ${LOCATION}/features ${LOCATION}/plugins
 do
+		# add "-verbose" to the second line if needed:
         find ${dir} -type f -name \*.jar -exec \
-                ${JAVA8} -jar ${JARPROCESSOR} -verbose -pack -outputDir ${dir} {} \;
+                ${JAVA8} -jar ${JARPROCESSOR} -pack -outputDir ${dir} {} \;
 done
 
 
@@ -234,30 +241,28 @@
 
 if [ "${PROMOTE}" != "false" ]
 then
-	BUILDID=`echo $OTDTVERSION | cut -d '.' -f 4`
 	if [ "${PROMOTE}" != "" ]
 	then
-        DEST=${UPDATES_BASE}/${2}/${PROMOTE}
-        # FIXME /bin/rm -rf ${DEST}
+        DEST_REL=${2}/${PROMOTE}
     else
-        DEST=${UPDATES_BASE}/${2}/${BUILDID}
+		BUILDID=`echo $OTDTVERSION | cut -d '.' -f 4`
+		if [ "${BUILDID}" != "" ]
+		then
+	        DEST_REL=${2}/${BUILDID}
+	    else
+			echo "Unrecognized OT version: $OTDTVERSION"
+			exit 1
+		fi
     fi
-	echo "====Step 11: promote to ${DEST}===="
-# FIXME: check is broken
-#	if [ -d ${UPDATES_BASE}/${2} ]
-#	then
-		# FIXME mkdir ${DEST}
-		# if [ "${MASTER}" != "none" ]
-		# then
-		    # FIXME
-			# cp -pr ${MASTER}/* ${DEST}/
-		# fi
-		scp -r . ${DEST}
-		#	chmod -R g+w ${DEST} && \
-		#	find ${DEST} -type d -exec /bin/ls -ld {} \;
-		# ls -latr ${UPDATES_BASE}/${2}
-#	else
-#		echo "${UPDATES_BASE}/${2} not found or not a directory"
-#	fi
+	echo "====Step 11: promote to ${TARGET_HOST}:{TARGET_BASEDIR}/${DEST_REL}===="
+	# FIXME mkdir ${DEST}
+	# if [ "${MASTER}" != "none" ]
+	# then
+	    # FIXME
+		# cp -pr ${MASTER}/* ${DEST}/
+	# fi
+	ssh ${TARGET_HOST} "/bin/rm -r ${TARGET_BASEDIR}/${DEST_REL} || true"
+	scp -r . ${TARGET_HOST}:${TARGET_BASEDIR}/${DEST_REL}
+	echo "Installed to ${TARGET_HTTPS}/${DEST_REL}"
 fi
 echo "====DONE===="
diff --git a/releng/build-scripts/bin/extractVersions b/releng/build-scripts/bin/extractVersions
index b34f506..e5f9794 100755
--- a/releng/build-scripts/bin/extractVersions
+++ b/releng/build-scripts/bin/extractVersions
@@ -36,6 +36,7 @@
 			JDT_VERSIONA=`echo ${JDT_VERSION_ALL}| sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[^-]*-\)[0-9]\{4\}.*/\1/'`
 			JDT_VERSIONB=`echo ${JDT_VERSION_ALL}| sed -e   's/[0-9]\+\.[0-9]\+\.[0-9]\+\.[^-]*-\([0-9]\{4\}\).*/\1/'`
 			JDT_VERSIONB_NEXT=`expr $JDT_VERSIONB + 1`
+			JDT_VERSIONB_NEXT=`printf "%04d" ${JDT_VERSIONB_NEXT}`
 			;;
 		org.eclipse.equinox.launcher*)
 			LAUNCHER_VERSION=$VERSION
diff --git a/releng/build-scripts/build/otdt_runtests-hipp.sh b/releng/build-scripts/build/otdt_runtests-hipp.sh
index 4559476..9d96cf7 100755
--- a/releng/build-scripts/build/otdt_runtests-hipp.sh
+++ b/releng/build-scripts/build/otdt_runtests-hipp.sh
@@ -27,7 +27,7 @@
 # FETCH_CACHE_LOCATION	git working area holding caches for fetch
 # MAP_FILE_PATH			path to the otdt.map file (original location of otdt.map.in)
 # ANT_PROFILE           configure the ant process
-# NICE                  niceness value for nice -n ${NICE}
+# SIGN					"nosign" or empty
 # =============================================================================
 # OUTPUT: Variables passed to the toplevel ant script
 # -----------------------------------------------------------------------------
@@ -39,7 +39,6 @@
 ##      -Declipse-app.tgz       path of eclipse SDK
 ##      -Declipse.tests.zip     path of eclipse test framework
 ##		-Dpublished.updates		path to previously published things
-##      -Ddo.build.all          true|false: should OTDT and tests be built?
 ##      -Ddo.run.tests          true|false: should test be run?
 ##    	-DfetchCacheLocation    git working area holding caches for fetch
 ##		-Dmap.file.path			path to the otdt.map file (original location of otdt.map.in)
@@ -47,12 +46,12 @@
 # =============================================================================
 
 # CONSTANTS (FOR NOW):
-
+# option baseRepo is currently broken
 baseRepo=none
-statsRepo=ot2.8
-statsVersion=2.8.2
+export UPDATE_SITE_BASE=ot2.8
+export OT_VERSION=2.8.2
+# during the build we always publish to 'staging':
 export PROMOTE=staging
-export SIGN=""
 
 usage()
 {
@@ -84,16 +83,10 @@
 #LOCAL: main ant target:
 MAIN_TARGET=${MAIN_TARGET:="ot-junit-all"}
 
-#LOCAL: should OTDT and tests be built?
-DO_BUILD="true"
-
 #LOCAL: should the tests be run?
 DO_RUN="true"
 
 case ${MAIN_TARGET} in
-	"ot-junit-run")
-		DO_BUILD="false"
-		;;
 	"ot-compiler-build")
 		;&
 	"ot-junit-build")
@@ -107,19 +100,6 @@
 test -d "$OT_TESTSUITE_DIR" || mkdir -p "$OT_TESTSUITE_DIR"
 cd "$OT_TESTSUITE_DIR"
 
-# cleanup previous:
-if [ "$DO_BUILD" == "true" ]
-then
-	rm -rf build-root
-	rm -rf test-root
-	rm -rf updateSite
-    rm -rf updateSiteTests
-    rm -rf updateSiteCompiler
-	rm -rf metadata
-	rm -rf ecj
-else
-	rm -f test-root/eclipse/results/*
-fi
 
 # preload metadata for appending:
 if [ -f "${METADATA}/content.xml" ]
@@ -137,7 +117,6 @@
     -Declipse.sdk.qualifier=${SDK_QUALIFIER} \
     -Dpublished.updates=${PUBLISHED_UPDATES} \
     -Ddo.run.tests=${DO_RUN} \
-    -Ddo.build.all=${DO_BUILD} \
     -Dtest.tmpDir=${TEST_TMPDIR} \
     -DfetchCacheLocation=${FETCH_CACHE_LOCATION} \
     -Dmap.file.path=${MAP_FILE_PATH} \
@@ -146,8 +125,11 @@
 ANT_OPTS="-Xmx1024m"
 export ANT_OPTS
 
+# 1. build OTDT
+# 2. create & publish the update site
+# 3. run tests using (1)
 ant -f ${BUILDFILE} ${ANT_OPTIONS} createOTDTEclipse &&  \
-	( cd .. ; ./releng/build-scripts/bin/createRepository-hipp.sh ${baseRepo} ${statsRepo} ${statsVersion} ) && \
+	( cd .. ; ./releng/build-scripts/bin/createRepository-hipp.sh ${baseRepo} ${UPDATE_SITE_BASE} ${OT_VERSION} ) && \
 	ant -f ${BUILDFILE} ${ANT_OPTIONS} ${MAIN_TARGET}
 
 trap - INT
diff --git a/releng/build-scripts/build/run.xml b/releng/build-scripts/build/run.xml
index c3cdcfd..61ed721 100644
--- a/releng/build-scripts/build/run.xml
+++ b/releng/build-scripts/build/run.xml
@@ -352,7 +352,6 @@
 				<arg value="-Dmap.file.path=${map.file.path}"/>
 		    	<arg value="-DfetchCacheLocation=${fetchCacheLocation}"/>
 				<arg value="-Ddo.run.tests=${do.run.tests}"/>
-				<arg value="-Ddo.build.all=${do.build.all}"/>
 				<arg value="-Declipse-app.tgz=${eclipse-app.tgz}"/>
 				<arg value="-Declipse.tests.zip=${eclipse.tests.zip}"/>
 				<arg value="-Djdt.compiler.apt=${jdt.compiler.apt}"/>