Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » p2 director: Any success/failure tests?
p2 director: Any success/failure tests? [message #642717] Thu, 02 December 2010 13:16 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
[The eclipse.p2 newsgroup seems to be completely silent.
Therefore I retry on this group.]

Our installation program is supposed to allow installation of additional
plugins to our RCP application using the p2 director as described in

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/p2_director.html

1) How can we test that the installation succeeds?

2) There exists the parameter -verifyOnly described as

"only verify that the actions can be performed. Don't actually install
or remove anything."

First, I observe that calling with this parameter changes *something*,
e.g. there are new directories in the configuration folder after that.

Second, the same question applies to this call: How can we recognice a
success?

I observe that on failure a .log file is produced in the configuration
directory, but this seems not to be documented (AFAIK). Are we really
supposed to search for such a log file as indicator?

Thanks & Greetings from Bremen,

Daniel Krügler
Re: p2 director: Any success/failure tests? [message #642808 is a reply to message #642717] Thu, 02 December 2010 18:30 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Wouldn't the director return a "failed" exit code if it fails? Although
that's more reliable to check on linux than on all platforms.

You can use the director call with your application profile and -list to
check if it was installed. ex:

eclipse/eclipse -noSplash \
-application org.eclipse.equinox.p2.director \
-repository \
file:$(pwd)/eclipse/p2/org.eclipse.equinox.p2.engine/profile Registry/SDKProfile.profile
\
-list

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: p2 director: Any success/failure tests? [message #642895 is a reply to message #642808] Fri, 03 December 2010 09:00 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 12/2/2010 19:30, Paul Webster wrote:
> Wouldn't the director return a "failed" exit code if it fails? Although
> that's more reliable to check on linux than on all platforms.

According to our installation guys it doesn't (we have a Windows
platform). Even worse: It seems that calling the director does not
invoke synchronously: The installation cannot just delete temporary
files immediately after the invocation, because the process may still
need to access the files. This makes it hard to integrate the director
into our installation process.

> You can use the director call with your application profile and -list to
> check if it was installed. ex:
>
> eclipse/eclipse -noSplash \
> -application org.eclipse.equinox.p2.director \
> -repository \
> file:$(pwd)/eclipse/p2/org.eclipse.equinox.p2.engine/profile Registry/SDKProfile.profile
> \
> -list

The description of -list only says:

"lists all IU's found in the given repositories in a property like
format. IUs can optionally be listed. Each entry in the list is in the
form <id> [ '/' <version> ]."

This does not sound as if this would be useful for a validation. In
fact, I don't want that the installer is required to know all IU's that
were installed (this is only interesting for an after-the-fact
analysis), but I want to get feedback, whether the installation has
succeeded or not. Details of failures are relevant after this (and one
could try to search for the most recently written log file), but the
lack of a general OK/ERROR feedback from the director is very bad in a
multi-step installation that needs to ensure that each step (among which
the director call is only one) has succeeded or not.

Thanks & Greetings from Bremen,

Daniel Krügler
Re: p2 director: Any success/failure tests? [message #643308 is a reply to message #642895] Mon, 06 December 2010 13:03 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Daniel Krügler wrote:
> On 12/2/2010 19:30, Paul Webster wrote:
>> Wouldn't the director return a "failed" exit code if it fails? Although
>> that's more reliable to check on linux than on all platforms.
>
> According to our installation guys it doesn't (we have a Windows
> platform). Even worse: It seems that calling the director does not
> invoke synchronously: The installation cannot just delete temporary
> files immediately after the invocation, because the process may still
> need to access the files. This makes it hard to integrate the director
> into our installation process.

that's probably because by default, eclipse.exe calls javaw.exe. That's
not what you want (maybe call it with -vm c:\whatever\bin\java.exe
instead of javaw.exe).

If you were to run java.exe -jar
eclipse\plugins\org.eclipse.equinox.launcher_1.2.0.v20101119 .jar
-application org.eclipse.equinox.p2.director <rest of command>

and it doesn't return non-0 on fail, open a bug against RT Equinox
Framework (or there might be a launcher component now).

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: p2 director: Any success/failure tests? [message #643357 is a reply to message #643308] Mon, 06 December 2010 15:38 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 12/6/2010 14:03, Paul Webster wrote:
> Daniel Krügler wrote:
>> On 12/2/2010 19:30, Paul Webster wrote:
>>> Wouldn't the director return a "failed" exit code if it fails? Although
>>> that's more reliable to check on linux than on all platforms.
>>
>> According to our installation guys it doesn't (we have a Windows
>> platform). Even worse: It seems that calling the director does not
>> invoke synchronously: The installation cannot just delete temporary
>> files immediately after the invocation, because the process may still
>> need to access the files. This makes it hard to integrate the director
>> into our installation process.
>
> that's probably because by default, eclipse.exe calls javaw.exe. That's
> not what you want (maybe call it with -vm c:\whatever\bin\java.exe
> instead of javaw.exe).
>
> If you were to run java.exe -jar
> eclipse\plugins\org.eclipse.equinox.launcher_1.2.0.v20101119 .jar
> -application org.eclipse.equinox.p2.director <rest of command>

Thanks Paul, this sounds like a brilliant idea - we will test this
approach and give feedback to the group!

Greetings from Bremen,

- Daniel
Previous Topic:set availible software update site while creating the product
Next Topic:ToolBar update upon perspective switch
Goto Forum:
  


Current Time: Mon Nov 24 12:43:18 GMT 2014

Powered by FUDForum. Page generated in 0.03600 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software