Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/SimpleBackupStoreTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/SimpleBackupStore.java17
4 files changed, 17 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/SimpleBackupStoreTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/SimpleBackupStoreTest.java
index 0fa1cda76..a6f270835 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/SimpleBackupStoreTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/SimpleBackupStoreTest.java
@@ -110,7 +110,12 @@ public class SimpleBackupStoreTest extends AbstractProvisioningTest {
super.move(a, b);
}
// Everything else - fail
- else {
+ else if (a.getFileName().endsWith("eclipse.exe")) {
+ // Simulate what happens on Windows when moving a running executable between
+ // drives. In this case the file will be copied to the target but will not be
+ // removed from the source.
+ Files.copy(a, b);
+ } else {
throw new IOException("Test fail move: " + a + " -> " + b);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF
index d5c588998..fa30088a2 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.touchpoint.natives;singleton:=true
-Bundle-Version: 1.4.100.qualifier
+Bundle-Version: 1.4.200.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.touchpoint.natives.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/pom.xml b/bundles/org.eclipse.equinox.p2.touchpoint.natives/pom.xml
index 27c485442..e1c2e865d 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/pom.xml
@@ -9,6 +9,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.touchpoint.natives</artifactId>
- <version>1.4.100-SNAPSHOT</version>
+ <version>1.4.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/SimpleBackupStore.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/SimpleBackupStore.java
index 07bf4f9c5..b1c0261d7 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/SimpleBackupStore.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/SimpleBackupStore.java
@@ -587,14 +587,15 @@ public class SimpleBackupStore implements IBackupStore {
NLS.bind(Messages.BackupStore_file_directory_mismatch, buPathDir.toAbsolutePath()), e);
}
- try {
- move(path, buPath);
- } catch (IOException e) {
- // TODO Log exception?
- if (!isEclipseExe(path)) {
- throw e;
- }
-
+ move(path, buPath);
+ if (isEclipseExe(path) && Files.isRegularFile(path)) {
+ // The original is the launcher executable and it still exists at the original
+ // location although the move succeeded.
+ // This happens when it is the Windows executable that is locked because it's
+ // running and we are attempting to move it to a different drive.
+ // In this case the target will exist as a copy, so we should delete it.
+ // Then backup in place which will necessarily be on the same drive.
+ Files.delete(buPath);
Path inPlaceBuPath = toInPlaceBackupPath(path);
move(path, inPlaceBuPath);
buInPlace.add(inPlaceBuPath);

Back to the top