Johnson,
The UC2 project has developed a Java client API for pkg(5). It has some
limitations at this point, including the lack of the feature that you
are asking for (a progress interface), but for use by a Java program,
you might want to take a look. Currently, this API is 100% Java, but
the intent is to change this to use Jython so that the Python code from
pkg(5) will be executing directly. That is planned to happen in the
first quarter of next year.
The Javadocs are here:
http://download.java.net/updatecenter2/promoted/latest/javadocs/
Please let me know if you would like to discuss this further.
Tom
Stephen Hahn wrote:
* Johnson Lin <[EMAIL PROTECTED]> [2008-12-02 18:16]:
Stephen Hahn wrote:
* Johnson Lin <[EMAIL PROTECTED]> [2008-12-02 17:57]:
I am working Sun xVM Server update function that depends on IPS update
APIs and Solaris pkg command as backend.
There is a new feature request recently to ask for IPS update progress
status during a update job execution
so the UI progress bar can report status of a job such as 10%, 20%,
...to 100% etc as it proceeds.
Can pkg command such as install, refresh, and image-update etc support
this status update feature?
I would like to see a programmatic interface in pkg command to report
update progress status since
to parse the stdout from pkg command may not be a good idea.
Actually, I think your RFE is for a parseable output format from
pkg(1). Unless you are proposing using the Python client API (which
already has a progress reporting mechanism)?
No. I was not asking for a parsable output format unless there is no API
that can be used.
There is no API to externally query a running pkg(1) instance about
its progress. Having a client API to perform a variety of operations
in a stable fashion, we are unlikely to add such an interface. A
parseable output format is needed, however.
Can you describe more for the Python client API to report update progress?
It's documented in doc/client_api_versions.txt in our source tree.
How do I integrate the API into our existing java codes?
I suppose you could embed a Python interpreter in a JNI class and
manipulate that. Complicated. Maybe others have better
suggestions...
- Stephen
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss