Bug 128714

Summary: InstallCommand does not compare URLs correctly
Product: [Eclipse Project] Platform Reporter: James D. Miles <jdmiles>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: Branko Tripkovic <btripkov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: doug_macdonald, jeffmcaffer, pam_tobias, steven.wasleski, wassim.melhem
Version: 3.2   
Target Milestone: 3.2 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description James D. Miles CLA 2006-02-20 15:23:23 EST
The -to site argument is compared to existing sites using URL.sameFile.
This results in a failed comparison for partitions when case is wrong. ie C: versus c:.

Here is the patch
### Eclipse Workspace Patch 1.0
#P org.eclipse.update.core
Index: src/org/eclipse/update/standalone/InstallCommand.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.update.core/src/org/eclipse/update/standalone/InstallCommand.java,v
retrieving revision 1.18
diff -u -r1.18 InstallCommand.java
--- src/org/eclipse/update/standalone/InstallCommand.java	3 Jun 2005 17:40:49 -0000	1.18
+++ src/org/eclipse/update/standalone/InstallCommand.java	20 Feb 2006 19:41:04 -0000
@@ -29,6 +29,7 @@
 import org.eclipse.update.internal.configurator.UpdateURLDecoder;
 import org.eclipse.update.internal.core.Messages;
 import org.eclipse.update.internal.core.UpdateCore;
+import org.eclipse.update.internal.core.UpdateManagerUtils;
 import org.eclipse.update.internal.operations.DuplicateConflictsValidator;
 import org.eclipse.update.internal.operations.UpdateUtils;
 import org.eclipse.update.internal.search.SiteSearchCategory;
@@ -211,9 +212,9 @@
 
 		for (int i = 0; i < configuredSites.length; i++) {
 			IConfiguredSite csite = configuredSites[i];
-			if (csite.getSite().getURL().sameFile(sitePath.toURL())) 
+			if(UpdateManagerUtils.sameURL(csite.getSite().getURL(),sitePath.toURL()))
 				return csite;
-			else if (secondaryPath != null && csite.getSite().getURL().sameFile(secondaryPath.toURL())) 
+			else if(secondaryPath != null && UpdateManagerUtils.sameURL(csite.getSite().getURL(),secondaryPath.toURL()))
 				return csite;
 		}
Comment 1 Steven Wasleski CLA 2006-05-01 13:35:19 EDT
What is the outlook for getting this bug fixed in 3.2?
Comment 2 Dejan Glozic CLA 2006-05-01 13:40:20 EDT
Ideally we prefer patches added as an attachment.

We need to test the patch and see if there are no side effects. I think it is reasonably safe and isolated (in the InstallCommand) but we are in the post-RC2 phase and no fixes should be done lightly.

Branko, we will add this one to the list of RC3 candidates. We need to test for risks and provide risk assesment for approvers (i.e. here).
Comment 3 Branko Tripkovic CLA 2006-05-03 13:21:42 EDT
Released.
Comment 4 Dejan Glozic CLA 2006-05-03 15:01:19 EDT
Need formal votes.

Dejan adds +1.
Comment 5 Dejan Glozic CLA 2006-05-03 15:02:00 EDT
Jeff, need additional +1 before releasing.
Comment 6 Dejan Glozic CLA 2006-05-03 16:38:57 EDT
Wassim, you can help Jeff to unblock this backlog. This bug is checked and ready to go.
Comment 7 Wassim Melhem CLA 2006-05-03 16:41:52 EDT
+1 for RC3
Comment 8 Branko Tripkovic CLA 2006-05-03 17:49:12 EDT
fixed