[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Update mechanism

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 <agerbig@xxxxxxxxxxxx> 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-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] Im Auftrag von David Orme
Gesendet: Montag, 4. April 2016 02:25


An: P2 developer discussions <p2-dev@xxxxxxxxxxx>
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 <agerbig@xxxxxxxxxxxx> 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-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] Im Auftrag von David Orme
Gesendet: Mittwoch, 30. MÃrz 2016 11:21
An: P2 developer discussions <p2-dev@xxxxxxxxxxx>
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" <agerbig@xxxxxxxxxxxx> 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

agerbig@xxxxxxxxxxxx | 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@xxxxxxxxxxx
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@xxxxxxxxxxx
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@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/p2-dev