Description: Make pde-build use the -data argument so it does not write
 to ~/workspace during auto-builds.
Fowarded: yes
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=322271
Bug-Debian: http://bugs.debian.org/592526
Author: Niels Thykier <niels@thykier.net>

diff --git a/pdebuild/eclipse-pdebuild.sh b/pdebuild/eclipse-pdebuild.sh
index bf9f039..0d528c3 100755
--- a/pdebuild/eclipse-pdebuild.sh
+++ b/pdebuild/eclipse-pdebuild.sh
@@ -123,6 +123,7 @@ sourceDir=$PWD
 buildDir=$PWD/build
 SDK=$buildDir/SDK
 homeDir=$buildDir/home
+workspaceDir=$homeDir/workspace
 datadir=/usr/lib
 pdeBuildDir=$datadir/eclipse/plugins/org.eclipse.pde.build_@PDEBUILDVERSION@
 
@@ -195,6 +196,11 @@ if [ $dryRun -ne 1 ]; then
     mkdir -p $homeDir
 fi
 
+echo "mkdir -p $workspaceDir"
+if [ $dryRun -ne 1 ]; then
+    mkdir -p $workspaceDir
+fi
+
 if [ -z $featureId ]; then
     findFeatureId
 fi
@@ -265,7 +271,10 @@ echo "Starting build:"
 
 if [ $testing != true ]; then
   java -cp $SDK/startup.jar \
+    -Duser.home=$homeDir \
+    $vmArgs \
     org.eclipse.core.launcher.Main \
+    -data $workspaceDir \
     -application org.eclipse.ant.core.antRunner \
     $debugPlatformArgs \
     -Dtype=feature \
@@ -278,14 +287,14 @@ if [ $testing != true ]; then
     -Dtesting="$testing" \
     $additionalArgs \
     -f $pdeBuildDir/scripts/build.xml \
-    -vmargs \
-    -Duser.home=$homeDir \
-    $vmArgs
 
 else
   echo "\
   java -cp $SDK/startup.jar \
+    -Duser.home=$homeDir \
+    $vmArgs \
     org.eclipse.core.launcher.Main \
+    -data $workspaceDir \
     -application org.eclipse.ant.core.antRunner \
     $debugPlatformArgs \
     -Dtype=feature \
@@ -298,9 +307,6 @@ else
     -Dtesting="$testing" \
     $additionalArgs \
     -f $pdeBuildDir/scripts/build.xml \
-    -vmargs \
-    -Duser.home=$homeDir \
-    $vmArgs
   "
 fi
 
