Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 273519 - File corruption when mirroring packed features.
Summary: File corruption when mirroring packed features.
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 RC1   Edit
Assignee: Matthew Piggott CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 269199 (view as bug list)
Depends on:
Blocks: 273240
  Show dependency tree
 
Reported: 2009-04-23 17:46 EDT by Thomas Hallgren CLA
Modified: 2009-05-04 13:45 EDT (History)
4 users (show)

See Also:


Attachments
SimpleArtifactRepository - Packed Features Rule (6.16 KB, patch)
2009-04-27 16:02 EDT, Matthew Piggott CLA
no flags Details | Diff
SimpleArtifactRepository - Packed Features Rule (6.27 KB, patch)
2009-04-27 16:18 EDT, Matthew Piggott CLA
no flags Details | Diff
Additional test (8.16 KB, patch)
2009-04-30 16:50 EDT, Matthew Piggott CLA
pascal: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2009-04-23 17:46:47 EDT
The following must apply to provoke the problem.

1. The source repository has ArtifactDescriptors with format=packed and an 'artifact.reference' property. This is the case when mirroring from an update site that has a site.xml but lacks P2 meta-data.
2. The artifact to mirror is not an osgi.bundle (a feature typically).
3. A RawMirrorRequest is used for the copy.

The RawMirrorRequest will use the 'artifact.reference' property to determine the source for the copy. This path ends with '.jar.pack.gz'. The destination is computed using the mapper. Since there is no rule for packed features, the destination path will end with '.jar'. The result is that the content of the .jar.pack.gz file is copied to a .jar file without processing. The resulting file looks like a jar but is really a packed file.
Comment 1 Matthew Piggott CLA 2009-04-27 16:02:55 EDT
Created attachment 133442 [details]
SimpleArtifactRepository - Packed Features Rule

The patch adds a mapping rule for packed features to new and to existing (if the rule doesn't already exist) SimpleArtifactRepositories.
Comment 2 Matthew Piggott CLA 2009-04-27 16:18:12 EDT
Created attachment 133445 [details]
SimpleArtifactRepository - Packed Features Rule

Slight problem with a test in the previous patch, this should correct it
Comment 3 Pascal Rapicault CLA 2009-04-29 15:44:47 EDT
After discussion we have decided to not do something as dramatic as what was done in the patch (The patch was inserting a new rule when loading the repo). This could result in unknown issues and could also break ppl with other rules who have repos out there, when the only ppl that are impacted by this problem right now are those with update site with features when they are mirroring files.

Consequently the only thing we are changing here is adding a rule to handle pack.gz files for features when a new artifact repository is created.
Comment 4 Pascal Rapicault CLA 2009-04-29 20:37:51 EDT
I left open because we need to have a regression test for this.
Comment 5 Pascal Rapicault CLA 2009-04-29 22:13:00 EDT
*** Bug 269199 has been marked as a duplicate of this bug. ***
Comment 6 Matthew Piggott CLA 2009-04-30 16:50:37 EDT
Created attachment 134013 [details]
Additional test
Comment 7 Pascal Rapicault CLA 2009-05-04 13:45:16 EDT
I have released the test attached.