Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326497 - Child will not be removed from CompositeArtifactRepository
Summary: Child will not be removed from CompositeArtifactRepository
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.7 M3   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-29 04:59 EDT by Matthias Kappeller CLA
Modified: 2010-09-29 08:34 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Kappeller CLA 2010-09-29 04:59:38 EDT
Build Identifier: 3.6.0

If a child needs to be removed from a composite artifact repository by an absolute URI (e.g. file:/C:/workspaces/jse.repo/plugins/repo.core.tests/Copy_test-repo-1/) the change will not be saved to the repository.

(Sorry at my workplace i'm not able to create a patch :( )
In Bundle org.eclipse.equinox.p2.artifact.repository, version 1.1.0.v20100513 class org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository method 'public void removeChild(URI childURI)' the flag 'removed' is not assigned if the URI is absolute.

actually:
URI other = childURI.isAbsolute() ? URIUtil.makeRelative(childURI, getLocation()) : URIUtil.makeAbsolute(childURI, getLocation());
if (!removed)
	childrenURIs.remove(other);

change to:
URI other = childURI.isAbsolute() ? URIUtil.makeRelative(childURI, getLocation()) : URIUtil.makeAbsolute(childURI, getLocation());
if (!removed)
	removed = childrenURIs.remove(other);


In org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository it's done this way.

Reproducible: Always
Comment 1 DJ Houghton CLA 2010-09-29 08:34:47 EDT
Good catch, thanks.
Fix released to HEAD.