Hi Alexander, Here, I think you need to consider your use-cases carefully. If you are always going to be upgrading, then InstallOperation will do the job. However, if you ever want to rollback a release, then you need SynchronizeOperation.
SynchronizeOperation basically says, "Whatever is in the P2 repo, make the running platform look like that." So if you want to rollback a release, then you remove the corresponding features/plugins from your repo and the next time the Director is called, it will remove the corresponding features/plugins from your running platform. I have a demo of that too, but that one is definitely out of date, as P2 was buggy at the time I wrote it and Pascal and I worked together to make it work. Part of this involved backporting the then-development P2 Director to the then-current Eclipse. But the demo code Pascal and I used as a POC should still illustrate the idea well enough. Hope this helps. It's here: https://github.com/coconutpalm/SynchronizeOperation Regards, Dave Orme On Mon, Apr 4, 2016 at 6:18 AM, Alexander Gerbig <ager...@systhemis.de> wrote: > Hi Dave, > > > > all the examples (labs) are working with a little work e. g. using the > current tycho version and eclipse version (Mars). But I have a problem with > the usage of org.eclipse.equinox.p2.operations.UpdateOperation. In all labs > of osgi-arch-patterns the > org.eclipse.equinox.p2.operations.InstallOperation is used. I tried to use > the UpdateOperation called by a menu-command after changing visible content > in the perspective view (also changing the version of plugin/feature) but > it does not work. > > > > Regards, > > Alex > > > > *Von:* p2-dev-boun...@eclipse.org [mailto:p2-dev-boun...@eclipse.org] *Im > Auftrag von *David Orme > *Gesendet:* Montag, 4. April 2016 02:25 > > *An:* P2 developer discussions <p2-dev@eclipse.org> > *Betreff:* Re: [p2-dev] Update mechanism > > > > Hi Alexander, > > > > Not sure how to respond to your query without walking through the code > with you step by step. Have you tried the code in the "final" folder, > containing the solution to the entire lab? You'll need to "mvn clean > install" the utilities.releng, then the perspectives.releng, and finally > the bootstrapper. > > > > It's entirely possible that the code is out of date, but my hope is that > it steers you in the right direction. > > > > If the final lab solution doesn't work for you, feel free to reach out > again. > > > > > > > Regards, > > > > Dave Orme > > > > On Thu, Mar 31, 2016 at 9:03 AM, Alexander Gerbig <ager...@systhemis.de> > wrote: > > Hi Dave, > > > > thanks for the tutorial. > > > > I set up the example rcp application as described in lab-2 of the tutorial > in osgi-arch-patterns. > > > > These are the steps I did: > > 1. Edit the Application.java class with the installFeature-Code > > 2. Added an UpdateHandler calling an UpdateOperation by executing a > menu entry in the running application > > 3. Export the product as described > > 4. Created the perspective plugin/feature/updatesite > > 5. Started the exported product and the view of the created > perspective plugin will be shown > > 6. I changed a visible entry in the view, the version of the plugin > and feature > > 7. Updated the site.xml and created the p2 update site > > 8. Started the exported product containing the installed feature > (version 1.0.0) and excuted the menu entry UpdateOperation > > > > I inserted some output during update. This is the result: > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.391 > > !MESSAGE Execute UpdateHandler! > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.399 > > !MESSAGE Execute updateFeature! > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.482 > > !MESSAGE Checking update site for updates: > http://localhost:8085/labs/lab-2/com.example.app.perspectives.p2/ > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.953 > > !MESSAGE Units to update: 4 > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.960 > > !MESSAGE Unit to update: > com.example.app.perspectives.feature.feature.group Version: > 1.1.0.201603311551 > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.967 > > !MESSAGE Unit to update: com.example.app.perspectives.feature.feature.jar > Version: 1.1.0.201603311551 > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.974 > > !MESSAGE Unit to update: Default Version: 1.0.0.21-cKxK367735E39955CC5 > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:01.981 > > !MESSAGE Unit to update: com.example.app.perspectives Version: > 1.1.0.201603311551 > > > > !ENTRY org.eclipse.equinox.p2.operations 1 10000 2016-03-31 15:52:02.242 > > !MESSAGE No updates were found. > > > > !ENTRY com.example.app.perspectives 1 0 2016-03-31 15:52:02.249 > > !MESSAGE Update finished! > > > > The IMetadataRepository recognizes the features in new versions but the > status of the UpdateOperation#resolveModal() is „No udpates were found.“. > > > > Can you give me a hint what may be wrong here? > > > > Best regards, Alex > > > > *Von:* p2-dev-boun...@eclipse.org [mailto:p2-dev-boun...@eclipse.org] *Im > Auftrag von *David Orme > *Gesendet:* Mittwoch, 30. März 2016 11:21 > *An:* P2 developer discussions <p2-dev@eclipse.org> > *Betreff:* Re: [p2-dev] Update mechanism > > > > A bit dated but the general approach still works: > https://github.com/coconutpalm/osgi-arch-patterns > > From an EclipseCon tutorial Patrick Paulin and I gave... > > Dave Orme > > On Mar 30, 2016 2:21 AM, "Alexander Gerbig" <ager...@systhemis.de> wrote: > > Hi p2-dev team, > > > > we are developing a rcp product with a lot of features. The features are > included in the product. The update mechanism is developed as described > > in the tutorial from Lars Vogel ( > http://www.vogella.com/tutorials/EclipseP2Update/article.html). > > > > When I change a plugin/feature and according to that the versions of these > and the product the update mechanism works. My question now: Is it > > possible to just deploy the changed feature into a p2 repository so the > update mechanism downloads only this feature? A local test of this scenario > was not successful. > > > > The rcp application knows the url of the p2 repository where the feature > is hosted. When I point the "install new feature" dialog of my IDE > > on this url the feature will be shown so the repository should be ok. > > > > When I deploy the whole rcp product with changed version number as p2 > repository the update mechanism works. But in that case the whole product > will be downloaded. > > > > Is it possible that updating a single feature which is delivered with the > product does not work? > > > > Thanks for your help! > > > > Bye Alex > > > > > > -- > > *Alexander Gerbig, Dipl.-Wirt.-Inf. (FH)* > > Softwareentwicklung und -beratung > > *T* +49 931 260 798 13 | *F* +49 931 260 798 29 > > ager...@systhemis.de | www.systhemis.de > > > > > > *SYSTHEMIS AG* | Ein Unternehmen der Prof. Thome Gruppe > Mergentheimer Str. 76a | 97082 Würzburg | Zentrale: +49 931 260 798 0 > Vorstand: Dr. Christian Schneider > Aufsichtsratsvorsitzender: Prof. Dr. Rainer Thome | HRB: 10523 (Würzburg) > > > _______________________________________________ > p2-dev mailing list > p2-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/p2-dev > > > > *SYSTHEMIS AG* | Ein Unternehmen der Prof. Thome Gruppe > Mergentheimer Str. 76a | 97082 Würzburg | Zentrale: +49 931 260 798 0 > Vorstand: Dr. Christian Schneider > Aufsichtsratsvorsitzender: Prof. Dr. Rainer Thome | HRB: 10523 (Würzburg) > > > _______________________________________________ > p2-dev mailing list > p2-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/p2-dev > > > > *SYSTHEMIS AG* | Ein Unternehmen der Prof. Thome Gruppe > Mergentheimer Str. 76a | 97082 Würzburg | Zentrale: +49 931 260 798 0 > Vorstand: Dr. Christian Schneider > Aufsichtsratsvorsitzender: Prof. Dr. Rainer Thome | HRB: 10523 (Würzburg) > > _______________________________________________ > p2-dev mailing list > p2-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/p2-dev >
_______________________________________________ p2-dev mailing list p2-dev@eclipse.org To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/p2-dev