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

Bug 313477

Summary: Add repositories via command line
Product: [Technology] CBI Reporter: Markus Kuppe <bugs.eclipse.org>
Component: CBI p2 Repository AggregatorAssignee: Project Inbox <b3.aggregator-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: thomas, victor.lenet
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 313305    
Attachments:
Description Flags
right direction?
thomas: iplog+
mylyn/context/zip none

Description Markus Kuppe CLA 2010-05-19 04:02:26 EDT
The b3 aggregator may support adding/removing repositories from the command line much like the p2 ant tasks do [0].

[0] http://wiki.eclipse.org/Equinox/p2/Ant_Tasks#Composite_Repository_Task
Comment 1 Markus Kuppe CLA 2010-09-16 07:55:56 EDT
Hi,

I'm currently exploring ways to implement this enhancement and wonder what would be the desired approach? 

a) Extending org.eclipse.b3.aggregator.engine.Builder so that it takes (additional) repository URL on the command line
b) A separate class (e.g. Modifier) that has dedicated commands to manipulate an aggregator model? This probably means moving some functionality from Builder into a common superclass of Builder and Modifier.

Markus
Comment 2 Markus Kuppe CLA 2010-09-16 09:26:30 EDT
Created attachment 179031 [details]
right direction?
Comment 3 Markus Kuppe CLA 2010-09-16 09:26:32 EDT
Created attachment 179032 [details]
mylyn/context/zip
Comment 4 Markus Kuppe CLA 2010-09-16 09:35:12 EDT
Corresponding command line is:

b3 modify --action [ADD|REMOVE] --buildModel /path/to/b3aggr --repoLocation URL
Comment 5 Thomas Hallgren CLA 2011-02-16 02:15:31 EST
Patch looks good. I applied it to trunk, rev 1422.

Thanks!
Comment 6 Victor Lenet CLA 2011-02-19 17:11:52 EST
Build version: b3 Aggregator Engine (Incubation) 0.1.0.r01434
available at http://download.eclipse.org/modeling/emft/b3/updates-3.6

Building or Verifying an even a simplest aggregated repository fails due to the following NPE:

Stack trace:
java.lang.NullPointerException
at org.eclipse.b3.aggregator.engine.Builder.run(Builder.java:785)
at org.eclipse.b3.aggregator.presentation.AggregatorActionBarContributor$BuildRepoAction$1.run(AggregatorActionBarContributor.java:267)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

The culprit is the rev 1422 which introduced ModelAbstractCommand base class of the Builder. New in ModelAbstractCommand is protected field resourceSet which is hidden in the Builder by its own private resourceSet. ModelAbstractCommand.resourceSet is initialized correctly but the Builder.resourceSet is not, causing an NPE.

The fix is to remove Builder.resourceSet private field.
Comment 7 Thomas Hallgren CLA 2011-02-20 01:11:36 EST
Thanks for catching and analyzing this. It's fixed now and a new build is running.

The fix is in trunk, rev 1436.
Comment 8 Thomas Hallgren CLA 2011-02-20 01:11:54 EST
.
Comment 9 David Williams CLA 2016-09-16 15:58:49 EDT
[Bookkeeping change only. Moving bugs to the new "home" of aggregator, CBI.
No change to assignee for resolved and verified bugs.]