[email protected] wrote:
On Fri, Dec 11, 2009 at 10:33:19PM -0600, Shawn Walker wrote:
webrev
======
http://cr.opensolaris.org/~swalker/pkg-license/
...
api.py:
...
  - get_licenses():

    - Should this be in ImagePlan, since it's an ImagePlan level
      manipulation?

There wasn't much point since it needs to return LicenseInfo objects which are client api level.

    - Using get_remote_opener is the most troublesome way to download
      these actions.  This calls get_datastream(), which returns a
      file-object to the caller.  You'll be reading the license one URL
      at a time.  This code also needs to catch and wrap TransportError,
      as the transport can't catch its own exceptions when the caller is
      performing the read instead of the transport.  This approach also
      doesn't retry if there's a failure.
IMO, it would be easier to use the MFile/get_files() approach that the
      transport currently uses for files and licenses, but just perform
      the license download first.  Then you would always have a local
      copy of the license available, unless the download was unable to
      find a copy of the license at any of the hosts.

So what I was trying to achieve here was avoiding the pre-download of the license text unless the client actually needed it. In short, I was intending for it to download the licenses one-by-one on demand as they were actually needed by the client.

However, I just realised that the client will have to install of these license files anyway, so there is likely little point in doing this since they will have to be downloaded.

The more I look at it, the more I think I need something like prefetch_manifests but for actions instead. Do you have any objections to me just copying what you've done for manifests and adding that as either prefetch_files or prefetch_actions?

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

Reply via email to