move to improved p2 functions
diff --git a/releng.wtpbuilder/components/wtp-patches312/customTargets.xml b/releng.wtpbuilder/components/wtp-patches312/customTargets.xml
index 3c1ddfb..1186ace 100644
--- a/releng.wtpbuilder/components/wtp-patches312/customTargets.xml
+++ b/releng.wtpbuilder/components/wtp-patches312/customTargets.xml
@@ -225,6 +225,9 @@
     -->
     <target
         name="postAssemble">
+    	
+    	
+    	
         <ant
             antfile="${wtp.builder.home}/scripts/build/buildutilitiesp2.xml"
             target="createTraditionalZipFiles">
diff --git a/releng.wtpbuilder/scripts/build/buildutilitiesp2.xml b/releng.wtpbuilder/scripts/build/buildutilitiesp2.xml
index 3bcc4ca..7fa53f1 100644
--- a/releng.wtpbuilder/scripts/build/buildutilitiesp2.xml
+++ b/releng.wtpbuilder/scripts/build/buildutilitiesp2.xml
@@ -12,7 +12,7 @@
         on your operating system are not, e.g. it will be ${env.Path}
         not ${env.PATH} on Windows
     -->
-    <property
+    <property 
         environment="env"/>
     <!--
         Let users override standard properties, if desired. If
@@ -70,90 +70,49 @@
     <property
         name="tmpsite"
         value="${buildDirectory}/tmpsite-${archiveName}-temp"/>
-    <!--
-        ==================================================================================
-        Primary Task: unpackUpdateJarsAndCreateZippedPackages This task
-        takes a zip file of update jars, which is created by PDE build
-        process, and "converts" it to a traditional zip file, processing
-        the jars with pack200 for better compression on update sites.
-        ==================================================================================
-    -->
     <target
-        name="unpackUpdateJarsAndCreateZippedPackages"
+        name="conditionAndSignJars"
         depends="init">
+    	<!--
+    	if="doSign">
+       -->
+    	<!-- 
+    	
+    	get zip for signing
+              exclude content* artifacts*
+              add pack.properties
+              send to eclipse and wait
+    	       write over p2.build.repo, 
+    	       but update content and artifacts files
+    	       remove temp file
+    	-->
+    	
+    	<zip
+    		destfile="${buildDirectory}/${buildLabel}/temp-${buildLabel}-${component}.zip">
+    		
+    	            <zipfileset
+    	                dir="${buildDirectory}/${buildLabel}/${component}/repository"
+    	                excludes="content.xml,content.jar,artifacts.xml,artifacts.jar"/>
+    		     <zipfileset
+    	                file="${wtp.builder.home}/scripts/build/pack.properties" />
+       </zip>
         <!--
             ==================================================================================
-            1. make "backup" copy of original zip, if debugging, since
-            might be needed for comparison
+             sign the jars in archive file
             ==================================================================================
         -->
-        <antcall
-            target="makeBackupCopyForDebugging"/>
-        <!--
-            add pack.properties file that specifies effort level, and
-            files not to sign We don't have to do this if not
-            normalizing and not signing
-        -->
-        <antcall
-            target="updatePackPropertiesFile"/>
-        <!--
-            ==================================================================================
-            2. normalize jars here, from a zip file of update jars. The
-            normalized jars are put in zip file of same name, in a
-            directory named normalized
-            ==================================================================================
-        -->
-        <echo
-            level="info"
-            message="normalize jars if desired ..."/>
-        <antcall
-            target="normalizeJarFiles"/>
-        <echo
-            level="info"
-            message="normalized jars: ${normalizeJarFiles}"/>
-        <!--
-            ==================================================================================
-            3. sign the jars in archive file, if desired
-            ==================================================================================
-        -->
+        	<!--
         <ant
-            antfile="${wtp.builder.home}/scripts/build/signjars.xml"/>
-        <!--
+            antfile="${wtp.builder.home}/scripts/build/signjars.xml" >
+    	
+    	    <property name="archiveName" value="temp-${buildLabel}-${component}.zip"/>
+    	</ant>
+-->
+       <!-- remove our temp zip file, once tested, debugged -->
+    	
+    	<!--
             ==================================================================================
-            4. unzip the normalized jars in the zip file produced in
-            step 1., to the directory {tmpsite} for further processing.
-            plugins and features end up in {tmpsite}/eclipse
-            ==================================================================================
-        -->
-        <echo
-            level="info"
-            message="unzip normalized update jars to a holding place"/>
-        <echo
-            level="info"
-            message="tmpsite: ${tmpsite}"/>
-        <echo
-            level="info"
-            message="archiveDir: ${archiveDir}"/>
-        <echo
-            level="info"
-            message="archiveName: ${archiveName}"/>
-        <unzip
-            dest="${tmpsite}"
-            src="${archiveDir}/${archiveName}"/>
-        <!--
-            ==================================================================================
-            5. copy all update jars to a common update site directory,
-            if desired. Note: overwite is false to avoid "touching"
-            files already produced and processed by previous steps in a
-            larger build process. This means the repository *must* be
-            completely clean before the larger process starts.
-            ==================================================================================
-        -->
-        <antcall
-            target="makeCopyForUpdate"/>
-        <!--
-            ==================================================================================
-            6. for modularity, pack200 is done here, optionally. The
+             for modularity, pack200 is done here, optionally. The
             resulting gz files are produced in update site directory.
             This is optional since processing is expensive to do for
             every build. Only need when ready to declare an update site,
@@ -170,71 +129,8 @@
         <echo
             level="info"
             message="created pack files: ${packJarFiles}"/>
-        <!--
-            7. create a site.xml file, by merging a template site.xml
-            with the feature versions produced by PDE build
-        -->
-        <antcall
-            target="createSiteFiles"/>
 
-        <!-- 8. now generate P2 meta data for that P2 repo -->
-        <echo
-            level="info"
-            message="Generating p2 metadata for P2 repo."/>
-        <antcall
-            target="generateP2Metadata"/>
-        <!--
-            ==================================================================================
-            9. now create traditional zip file of unpacked jars. This
-            type of "unpack" is not related to pack200, but instead
-            means to unpack those jars that are supposed to be unpacked
-            based on feature defintion, if the plugin's unpack attribute
-            is set to true in the feature
-            ==================================================================================
-        -->
-        <!--  use releng task of unpackUpdateJars -->
-        <unpackUpdateJars
-            site="${tmpsite}/eclipse"
-            output="${tmpsite}/unpacked/eclipse"/>
-        <!--
-            add copy of legal doc's here, product.ini, etc., before
-            re-zipping
-        -->
-        <copy
-            todir="${tmpsite}/unpacked/eclipse"
-            overwrite="false">
-            <fileset
-                dir="${wtp.builder.home}/rootfiles">
-            </fileset>
-        </copy>
-        <!--
-            delete the zip file of update jars we started with, which we
-            are about to re-create as traditional zip file
-        -->
-        <delete
-            file="${buildDirectory}/${buildLabel}/${archiveName}"/>
-        <mkdir
-            dir="${buildDirectory}/${buildLabel}"/>
-        <!--
-            recreate zip file now, same name, traditional content, which
-            is mix of folders and jars
-        -->
-        <zip
-            destfile="${buildDirectory}/${buildLabel}/${archiveName}"
-            basedir="${tmpsite}/unpacked"
-            update="false"
-            duplicate="preserve"/>
-        <!-- always produce checksum files for any zips produced -->
-        <antcall
-            target="createChecksums"/>
-        <!--
-            ==================================================================================
-            10. can now remove tmpsite as no longer needed, unless
-            debugging
-            ==================================================================================
-        -->
-        <antcall
-            target="deleteTmpSite"/>
+   
     </target>
     <!--
         ==============================================================================================
@@ -342,12 +238,7 @@
         <echo
             message="doP2Repo: ${doP2Repo}"/>
     </target>
-    <target
-        name="deleteTmpSite"
-        unless="keepIfDebug">
-        <delete
-            dir="${tmpsite}"/>
-    </target>
+
     <target
         name="normalizeJarFiles"
         if="doNormalize"
@@ -391,22 +282,10 @@
         if="doPack"
         depends="init">
         <!--
-            stick with JAVA5 for signing/packing for now ... I've heard
-            rumors of some 'compatibility' issues with JAVA6?
+            stick with JAVA5 for signing/packing for now ... 
+            there are 'compatibility' issues with JAVA6?
         -->
-        <!--
-            <java
-            jar="${pde.builder.path}/plugins/org.eclipse.equinox.launcher.jar"
-            fork="true" jvm="${env.JAVA_5_HOME}/bin/java"
-            failonerror="true" maxmemory="512m" dir="${buildDirectory}">
-            <jvmarg
-            value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/> <arg
-            line="${logIfDebug}"/> <arg line="-application
-            org.eclipse.update.core.siteOptimizer"/> <arg
-            line="-jarProcessor ${verboseIfDebug} -outputDir
-            ${buildDirectory}/${buildLabel}/repository -pack
-            ${buildDirectory}/${buildLabel}/repository"/> </java>
-        -->
+      
         <java
             jar="${pde.builder.path}/plugins/org.eclipse.equinox.launcher.jar"
             fork="true"
@@ -423,6 +302,9 @@
             <arg
                 line="-jarProcessor  ${verboseIfDebug} -outputDir ${buildDirectory}/${buildLabel}/${component}/repository -pack ${buildDirectory}/${buildLabel}/${component}/repository"/>
         </java>
+	
+	<!-- TODO: need to udpate meta data! -->
+	
     </target>
     <!--
         always make copy, since normally either normalized, or signed
@@ -431,40 +313,6 @@
         signed.
     -->
     <target
-        name="makeCopyForUpdate">
-        <mkdir
-            dir="${buildDirectory}/${buildLabel}/repository"/>
-        <copy
-            todir="${buildDirectory}/${buildLabel}/repository"
-            overwrite="false">
-            <fileset
-                dir="${tmpsite}/eclipse">
-            </fileset>
-        </copy>
-        <mkdir
-            dir="${buildDirectory}/${buildLabel}/${component}/repository"/>
-        <copy
-            todir="${buildDirectory}/${buildLabel}/${component}/repository"
-            overwrite="false">
-            <fileset
-                dir="${tmpsite}/eclipse">
-            </fileset>
-        </copy>
-    </target>
-    <target
-        name="makeBackupCopyForDebugging"
-        if="keepIfDebug">
-        <!--
-            temporary copy while confirming build to be able to do
-            side-by-side comparisons
-        -->
-        <mkdir
-            dir="${buildDirectory}/backuporiginalzips"/>
-        <copy
-            file="${buildDirectory}/${buildLabel}/${archiveName}"
-            todir="${buildDirectory}/backuporiginalzips"/>
-    </target>
-    <target
         name="createChecksums">
         <!--
             This createChecksums task creates two files, for use in two
@@ -527,83 +375,8 @@
             message="doSign: ${doSign}"/>
     </target>
 
-    <!-- Call the p2 metadata generator on the update site. -->
-    <!-- TODO: do we need to pack200 files first? (create gz files?) -->
-    <target
-        name="generateP2Metadata"
-        depends="init"
-        if="doP2Repo">
 
 
-        <!-- 1. Generate the P2 metadata -->
-        <!--
-            initial generation now hanlded by p2.gathering=true in
-            build.properties
-        -->
-        <!--
-            TODO: should "merge" component repos into main one here?
-        -->
-        <!--
-            2. Create zip of P2 repo. Note we put it in
-            'repoBaseLocation' for use by subsequent build steps TODO:
-            investigate a location outside a per-build location
-        -->
-        <mkdir
-            dir="${buildDirectory}/${buildLabel}/repos"/>
-        <zip
-            destfile="${buildDirectory}/${buildLabel}/repos/${component}-buildrepo-${buildLabel}.zip"
-            basedir="${buildDirectory}/${buildLabel}/${component}/repository/"
-            excludes="${excludeFromRepoZip}"
-            update="yes"
-            duplicate="preserve">
-        </zip>
-        <!--
-            <zip
-            destfile="${buildDirectory}/${buildLabel}/repos/${build.distribution}-buildrepo-${buildLabel}.zip"
-            basedir="${buildDirectory}/${buildLabel}/repository/"
-            excludes="${excludeFromRepoZip}" update="yes"
-            duplicate="preserve"> </zip>
-        -->
-        <!--
-            3. generate maps each step TODO: avoid double processing by
-            changing task so that if file exists, append to it
-        -->
-        <generateMapFiles
-            buildlabel="${buildLabel}"
-            inputFilePluginVersions="${buildDirectory}/finalPluginsVersions.properties"
-            inputFileFeatureVersions="${buildDirectory}/finalFeaturesVersions.properties"
-            p2MapFile="${buildDirectory}/${buildLabel}/Web-Tools-Platform-${buildLabel}.p2.map"
-            p2Repository="http://build.eclipse.org/webtools/committers/${projectname}/${buildLabel}/repository"/>
-    </target>
-    <target
-        name="createSiteFiles"
-        depends="init"
-        if="doP2Repo">
-        <property
-            name="sitexmlfile"
-            value="${buildDirectory}/maps/webtools.maps/releng/sitefile/site.xml"/>
-        <property
-            file="${buildDirectory}/finalFeaturesVersions.properties"/>
-        <loadfile
-            property="sitefiletext"
-            srcFile="${sitexmlfile}">
-            <filterchain>
-                <expandproperties/>
-            </filterchain>
-        </loadfile>
-        <echo
-            message="${sitefiletext}"
-            file="${buildDirectory}/${buildLabel}/repository/site.xml"/>
-        <echo
-            message="${sitefiletext}"
-            file="${buildDirectory}/${buildLabel}/${component}/repository/site.xml"/>
-    </target>
-    <target
-        name="updatePackPropertiesFile"
-        if="doNormalize">
-        <updatePackProperties
-            archiveFilename="${buildDirectory}/${buildLabel}/${archiveName}"/>
-    </target>
     <target
         name="createTraditionalZipFiles"
         depends="init">