Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 262073

Summary: Errors upgrading shared install with install dir containing spaces
Product: [Eclipse Project] Equinox Reporter: John Arthorne <john.arthorne>
Component: p2Assignee: John Arthorne <john.arthorne>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pascal, simon_kaegi
Version: unspecified   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on: 262433    
Bug Blocks:    
Attachments:
Description Flags
Fix + tests v01 none

Description John Arthorne CLA 2009-01-22 14:45:43 EST
M20090121-1700

1) Install this build into c:\Program Files\eclipse
2) Upgrade to latest Eclipse 3.5 integration build
3) Try to perform a subsequent provisioning operation

-> A large number of errors occur. The root of the problem is that the 'org.eclipse.equinox.p2.cache.extensions' property contains space characters in the values, which explodes when trying to parse as a URI.

!ENTRY org.eclipse.equinox.p2.touchpoint.eclipse 4 0 2009-01-22 14:14:47.076
!MESSAGE Illegal character in path at index 16: file:/C:/Program Files/eclipse342/.eclipseextension
!STACK 0
java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Program Files/eclipse342/.eclipseextension
	at java.net.URI$Parser.fail(Unknown Source)
	at java.net.URI$Parser.checkChars(Unknown Source)
	at java.net.URI$Parser.parseHierarchical(Unknown Source)
	at java.net.URI$Parser.parse(Unknown Source)
	at java.net.URI.<init>(Unknown Source)
	at org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util.getAggregatedBundleRepository(Util.java:135)
	at org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util.getAggregatedBundleRepository(Util.java:102)
	at org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util.getArtifactFile(Util.java:192)
Comment 1 John Arthorne CLA 2009-01-22 14:46:35 EST
Here's the relevant snippet from the profile file. Note also the weird name of the installFolder property key.

<profile id='SDKProfile' timestamp='1232651687342'>
  <properties size='8'>
    <property name='org.eclipse.equinox.p2.cache' value='C:\Program Files\eclipse342'/>
    <property name='org.eclipse.equinox.p2.flavor' value='tooling'/>
    <property name='org.eclipse.equinox.p2.roaming' value='true'/>
    <property name='org.eclipse.update.install.features' value='true'/>
    <property name='org.eclipse.equinox.p2.environments' value='osgi.ws=win32,osgi.os=win32,osgi.arch=x86'/>
    <property name='org.eclipsFo1e.equinox.p2.installFolder' value='C:\Program Files\eclipse342'/>
    <property name='eclipse.touchpoint.launcherName' value='eclipse.exe'/>
    <property name='org.eclipse.equinox.p2.cache.extensions' value='file:/C:/Program Files/eclipse342/.eclipseextension|file:/C:/Program Files/eclipse342/configuration/org.eclipse.osgi/bundles/69/data/listener_1925729951/'/>
  </properties>
Comment 2 John Arthorne CLA 2009-01-22 14:48:00 EST
I think for backwards compatibility with 3.4.x we need to fall back to parsing an unencoded URL string from this property if we fail to parse as a URI.
Comment 3 Simon Kaegi CLA 2009-01-22 15:39:26 EST
(In reply to comment #2)
> I think for backwards compatibility with 3.4.x we need to fall back to parsing
> an unencoded URL string from this property if we fail to parse as a URI.

The code in simpleconfigurator might be good to use here as it has similar requirements.

Comment 4 Pascal Rapicault CLA 2009-01-22 16:15:10 EST
Tentatively marking for 3.5, however we should only worry about this if we want to support the update from 3.4 to 3.5.
Comment 5 John Arthorne CLA 2009-01-25 23:57:20 EST
> we should only worry about this if we want to support the update from 3.4 to 3.5.

We've been selling this as a major advantage of p2 over UM, so I think we should support this upgrade unless there are severe technical problems doing it. This particular case is relatively simple and we have dealt with this exact problem in other places where we have migrated from URL to URI.
Comment 6 John Arthorne CLA 2009-02-18 11:23:18 EST
Created attachment 126038 [details]
Fix + tests v01
Comment 7 John Arthorne CLA 2009-02-18 11:24:32 EST
Fixed in HEAD.