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

Bug 320075

Summary: Install an IU with Director makes -configuration path absolute
Product: [Eclipse Project] Equinox Reporter: Stefan Stern <stern.s>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
Batch file to install the RCP Delta pack into the SDK none

Description Stefan Stern CLA 2010-07-16 03:06:55 EDT
Build Identifier: I20100608-0911

Using the Director application to install an IU, will convert a relative path for the -configuration argument in the launcher.ini file into an absolute path.

Probably the call EclipseLauncherParser#getConfigurationLocation, where a relative path is converted into an absolute path, causes this behavior. 

The absolute path URI, written into the launcher.ini, is invalid. It states
'file:/D:/dev/myapp/conf' 
instead of 
'file:///D:/dev/myapp/conf'

Usually, using the director should not nail the installation at the current folder, by converting relative paths into absolute ones, preventing the app to be moved to another location without altering the INI-files.

Reproducible: Always

Steps to Reproduce:
1. Extract an Eclipse SDK 3.6
2. Rename the configuration folder into my.conf
3. Add the following lines to the eclipse.ini file:
-configuration
my.conf
4. invoke the director application to install a plugin or a feature.group, e.g. the org.eclipse.equinox.executable.feature.group, into the SDK, using the batch attached to this bug entry
5. Inspect the eclipse.ini and check the value for the -configuration parameter
Comment 1 Stefan Stern CLA 2010-07-16 03:09:07 EDT
Created attachment 174470 [details]
Batch file to install the RCP Delta pack into the SDK

Copy the batch into the root folder of an extracted Eclipse SDK, e.g. 'D:\dev\eclipse', and run it on a computer with internet access to download the bundles from the Helios P2 Repos.
Comment 2 Thomas Hallgren CLA 2010-07-16 03:11:49 EDT
(In reply to comment #0)
> The absolute path URI, written into the launcher.ini, is invalid. It states
> 'file:/D:/dev/myapp/conf' 
> instead of 
> 'file:///D:/dev/myapp/conf'
> 
Why do you consider the first one invalid?
Comment 3 Stefan Stern CLA 2010-07-16 03:23:11 EDT
As a URL pointing to a file begins with 'file://', followed by a path. Starting from root, the path must start with a '/', resulting in file:///D:/dev/eclipse/my.conf'

For further information see RFC1738, 3.10 FILES

http://www.rfc-editor.org/rfc/rfc1738.txt

Regards,
Stefan
Comment 4 Thomas Hallgren CLA 2010-07-16 03:45:01 EDT
I know that the spec says that a file URL should be in the form file:// but in practice, the // can be omitted in most cases (see http://en.wikipedia.org/wiki/File_URI_scheme).

The reason I ask is that I wonder how this is relevant to the absolute versus relative path problem. Do you actually experience a problem due to the lacking '//' ?
Comment 5 Stefan Stern CLA 2010-07-16 04:22:02 EDT
No, the missing '//' isn't really part of the problem, I guess. But when writing the configuration back to the INI file, it seems that a 'makeRelative' call takes place before writing the path to the INI file. 

I haven't debugged that yet, but a possible cause for the relative->absolute problem might be, that the 'makeAbsolute' and 'makeRelative' calls have different expectations concerning the amount of slashes. But thats just a suspicion.
Comment 6 Stefan Stern CLA 2010-07-16 04:44:09 EDT
I just finished the debug session. The '/'-count isn't the bug.

In
'EclipseLauncherParser.setConfigurationLocation(List, URI, LauncherData) line: 233'
the value for property EquinoxConstants.OPTION_CONFIGURATION is set only, if the current value is null. But when modifying an existing value, the property is always set, and the value is always an absolute path. 

If the check for "null" was removed, the proper relative path would be set, but this would overwrite a possibly existing absolute value with a relative one. 

A fix would possibly require to remember whether the initial value was relative or absolute from the start.
Comment 7 Eclipse Webmaster CLA 2019-09-06 15:36:21 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 8 Eclipse Genie CLA 2021-08-27 13:38:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.