On Thu, 2010-10-28 at 17:21 -0700, Chris Quenelle wrote:
> When I try to use a file: repo with importer.py, it throws an exception.
> This seems to fix it:

Right, but this potentially breaks proper automatic SMF dependency
calculation for packages that ship manifests.

The intent of the code is to search for, and download all packages
containing SMF manifests from the pkg server you're importing to at the
release specified.  If that code doesn't run, we fall back to using the
SMF manifests installed on the machine running importer.

If those manifests differ from the manifests present in the IPS
repository at the build you're importing to, we may report incorrect
dependencies, or none at all for SMF-manifest-delivering packages that
you're trying to import.  Returning an empty list is almost certainly
the wrong thing to do here.

        cheers,
                        tim


> % hg diff importer.py
> diff -r e49306fc2b7c src/util/distro-import/importer.py
> --- a/src/util/distro-import/importer.py    Mon Oct 25 15:45:59 2010 -0700
> +++ b/src/util/distro-import/importer.py    Thu Oct 28 17:15:53 2010 -0700
> @@ -1076,11 +1076,16 @@
>           refresh_allowed = True
> 
>           # create a temporary image
> -        api_inst = pkg.client.api.image_create(PKG_CLIENT_NAME,
> -            CLIENT_API_VERSION, image_dir, pkg.client.api.IMG_TYPE_USER,
> -            is_zone, facets=pkg.facet.Facets(), force=False,
> -            progtrack=tracker, refresh_allowed=refresh_allowed,
> -            repo_uri=server_url)
> +        try:
> +            api_inst = pkg.client.api.image_create(PKG_CLIENT_NAME,
> +                CLIENT_API_VERSION, image_dir, 
> pkg.client.api.IMG_TYPE_USER,
> +                is_zone, facets=pkg.facet.Facets(), force=False,
> +                progtrack=tracker, refresh_allowed=refresh_allowed,
> +                repo_uri=server_url)
> +        except:
> +            print "image_create failed trying to get SMF package list"
> +            os.chdir(dir)
> +            return [ ]
> 
>           api_inst = pkg.client.api.ImageInterface(image_dir,
>               pkg.client.api.CURRENT_API_VERSION, tracker, None, 
> PKG_CLIENT_NAME)
> 
> _______________________________________________
> pkg-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/pkg-discuss


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

Reply via email to