Bug 225111

Summary: Generator writes repository many times
Product: [Eclipse Project] Equinox Reporter: John Arthorne <john.arthorne>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: performance
Version: 3.4   
Target Milestone: 3.4 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

Description John Arthorne CLA 2008-04-01 10:43:03 EDT
Generator.generateBundleConfigIUs loops over all bundles, and creates a CU for each bundle that needs one. It then adds them to the repository one at a time:

  metadataRepository.addInstallableUnits(new IInstallableUnit[] {cu});

It should instead gather the CUs to add, and then add them all to the repository at once outside the loop. Otherwise, the repository file is being written once for each generated CU.
Comment 1 DJ Houghton CLA 2008-04-03 11:03:03 EDT
Created attachment 94735 [details]
patch

Here is a potential patch. Note there was a comment in the original code about making sure the CUs are added before the product query is run but I don't see a product query in that method. Is the comment out of date?
Comment 2 John Arthorne CLA 2008-04-03 11:07:39 EDT
The product query happens much later, in createProductIU. The comment is still relevant.
Comment 3 DJ Houghton CLA 2008-04-04 10:58:03 EDT
Ok, I've resurrected the comment and added a bit more info and released the patch.
Closing.