Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322690 - Incorrect SimpleArtifactRepository.getOutputStream result with raw OmniVersion
Summary: Incorrect SimpleArtifactRepository.getOutputStream result with raw OmniVersion
Status: RESOLVED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-13 16:42 EDT by Francois Misiak CLA
Modified: 2020-02-19 04:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Misiak CLA 2010-08-13 16:42:34 EDT
Build Identifier: Version: 3.6.0 Build id: I20100608-0911 

When you provide a IArtifactDescriptor which embeds a OmniVersion instance the implementation in
org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getOutputStream(IArtifactDescriptor descriptor) will fail.
SimpleArtifactRepository.createLocation will do a:
    URI result = mapper.map(getLocation(), key.getClassifier(), key.getId(), key.getVersion().toString(), descriptor.getProperty(IArtifactDescriptor.FORMAT));

to compute the location, but the key.getVersion().toString() will return a string that starts with "raw:" (because the version is a OmniVersion instance).
On win32 ':' is an invalid character in a filename, when the URI is mapped to a File instance the name will be automatically truncated, so the resulting OutputStream refers to a bogus filename will leads to a completely inconsistent result.

With the current version of P2 used, it seems that it is impossible to provision a feature into a p2 repository when the version is non OSGI compliant.


Reproducible: Always

Steps to Reproduce:
Simply try to provision a p2 repository using the public P2 API, but use a non-OSGI version format (e.g. "1.0").

Let me know if somebody can think of any workaround (besides reimplementing IFileArtifactRepository).
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:09:58 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 2 Ed Merks CLA 2020-02-19 04:22:48 EST
If this is still a problem, mostly that should just be avoided...