On 03/29/10 12:55 PM, William Schumann wrote:
Shawn,
On 03/26/10 05:31 PM, Shawn Walker wrote:

... pkg.client.global_settings.client_name must be set first before
using pkg.client.api.
What is client_name used for? What are its limitations?

It's just an identifier at the moment. For now, I'd suggest something like 'ai' or 'auto-installer' or 'caiman-ai'. In short, something without spaces. There's no length limit currently.

How is the CLIENT_API_VERSION to be used? How do I track pkg.client.api
for version updates to keep this value current in my application? What
happens to my application when package/pkg is updated to a new version
number for pkg.client.api?

CLIENT_API_VERSION is just a constant representing the version of the pkg.client.api that your application requires at a minimum to work or was last known to work with. This number is used by the API during ImageInterface.__init__() to determine whether a client is compatible with the current version of the API.

If the version provided by the client is in the list of versions compatible with the current API version, then your application should work, if it is not, a api_errors.VerssionsException() will be raised with a message stating that the provided version isn't compatible.

Every time a change to the visible client API is made (regardless of whether it is a change compatible with consumers of previous API versions), pkg.client.api.CURRENT_API_VERSION is incremented, and you can see its current value using 'pydoc pkg.client.api'.

The API maintains a list internally of all of the API versions that are considered to be 'compatible' with the CURRENT_API_VERSION. For example, CURRENT_API_VERSION is '34' at the moment, but it is not compatible with any previous API versions (0-33).

The changes for each API version are summarised in the $PKG_GATE/doc/client_api_versions.txt file. According to that document, version 34 of the API is incompatible with all previous versions due to major API changes.

In short, clients should fail as soon as they try to create an ImageInterface object if the API has changed (possibly) incompatibly. Keep in mind that in many cases, incompatible changes in the API may not affect the client at all. For example, version 34 of the API was only considered incompatible with previous API versions because it removed some *deprecated* functions. If the client already wasn't using those, then it wouldn't matter.

I opened a bug last week related to documenting these basic client setup processes:

http://defect.opensolaris.org/bz/show_bug.cgi?id=15373

If I do, as mentioned before:
api_inst = api.image_create(PKG_CLIENT_NAME, CLIENT_API_VERSION, img_dir,
api.IMG_TYPE_ENTIRE, False, repo_uri="http://ipkg.sfbay/dev";,
progtrack=progress.FancyUNIXProgressTracker(), force=True)
With an expanded package list that AI would normally use:
pkglist=["entire", "SUNWcsd", "SUNWcs", "babel_install"]
...
File "/usr/lib/python2.6/vendor-packages/pkg/cfgfiles.py", line 166,
in setvalue
lineno = max((self.index[k][2] for k in self.index)) + 1
ValueError: max() arg is an empty sequence
Have I executed the plan correctly?

Yes, but unfortunately, I think you've hit a known bug:

  http://defect.opensolaris.org/bz/show_bug.cgi?id=1637

I don't believe you can currently plan the installation of an entire system in one step due to that bug; at least not without some trickery.

Until bug 1637 is resolved, your best option is probably to either fake up the passwd, group, etc. files or to copy the ones from the LiveCD to the target install image area temporarily while you're planning.

Danek may have a better suggestion or might correct me on this.

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to