Skip to main content

[pkg-discuss] Re: Code review for 15960202

  • From: Albert White < >
  • To:
  • Subject: [pkg-discuss] Re: Code review for 15960202
  • Date: Mon, 27 May 2013 13:13:23 +0100

Hi,

ok last time for this one hopefully. Ed suggested another wording change.

Cheers,
~Al

$ hg diff
diff -r 4ef4c591c6aa src/modules/client/pkg_solver.py
--- a/src/modules/client/pkg_solver.py    Wed May 22 09:55:43 2013 -0700
+++ b/src/modules/client/pkg_solver.py    Mon May 27 12:27:46 2013 +0100
@@ -21,7 +21,7 @@
 #

 #
-# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights 
reserved.
+# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights 
reserved.
 #

 import time
@@ -2072,16 +2072,24 @@

                 if fmri.pkg_name not in self.__parent_dict:
                         # package is not installed in parent
-                        reason = (N_("Package is not installed in "
-                            "parent image: {0}"), (fmri.pkg_name,))
+                        if self.__is_zone():
+ reason = (N_("Package {0} is not installed in "
+                                    "global zone."), (fmri.pkg_name,))
+                        else:
+ reason = (N_("Package {0} is not installed in "
+                                    "parent image."), (fmri.pkg_name,))
                         self.__trim(pkg_fmri, reason)
                         return False

                 pf = self.__parent_dict[fmri.pkg_name]
                 if fmri.publisher and fmri.publisher != pf.publisher:
                         # package is from a different publisher in the parent
-                        reason = (N_("Package in parent is from a "
-                            "different publisher: {0}"), (pf,))
+                        if self.__is_zone():
+                                reason = (N_("Package in global zone is from 
"
+                                    "a different publisher: {0}"), (pf,))
+                        else:
+                                reason = (N_("Package in parent is from a "
+                                    "different publisher: {0}"), (pf,))
                         self.__trim(pkg_fmri, reason)
                         return False

@@ -2093,11 +2101,19 @@
                 # version mismatch
                 if pf.version.is_successor(fmri.version,
                     version.CONSTRAINT_NONE):
-                        reason = (N_("Parent image has a incompatible newer "
-                            "version: {0}"), (pf,))
+                        if self.__is_zone():
+                                reason = (N_("Global zone has a "
+                                    "newer version: {0}"), (pf,))
+                        else:
+                                reason = (N_("Parent image has a "
+                                    "newer version: {0}"), (pf,))
                 else:
-                        reason = (N_("Parent image has an older version of "
-                            "package: {0}"), (pf,))
+                        if self.__is_zone():
+                                reason = (N_("Global zone has an older "
+                                    "version of package: {0}"), (pf,))
+                        else:
+                                reason = (N_("Parent image has an older "
+                                    "version of package: {0}"), (pf,))

                 self.__trim(pkg_fmri, reason)
                 return False
@@ -2203,3 +2219,11 @@
                         if f not in self.__trim_dict
                         ]
                 return ret
+
+        def __is_zone(self):
+                """Return True if image is a nonglobal zone"""
+                if 'variant.opensolaris.zone' in self.__variants:
+ return self.__variants['variant.opensolaris.zone'] == \
+                            'nonglobal'
+                else:
+                        return False


On 04/23/13 03:43 PM, Albert White wrote:
Hi,

Thanks for the feedback.

I've the changes at https://ips.java.net/webrev/albertw/15960202/

Cheers,
~Al

On 03/04/2013 19:17, 

 wrote:
The suggested code change is at:
https://hg.java.net/hg/ips~website-repo/raw-file/496b46ec7d55/webrev/albertw/15960202/index.html

This looks fine although the messages on lines 2077 and 2080 "read" a
bit funny as in

     Package is not installed in global zone:<name of package>

     Package is not installed in parent image:<name of package>

The package name reads as either the name of the global zone or the
parent image. Would you consider rewording this as in

     Package<name of package>  is not installed in the global zone.

     Package<name of package>  is not installed in the parent image.


[pkg-discuss] Re: Code review for 15960202

Albert White 05/27/2013

[pkg-discuss] Re: Code review for 15960202

Shawn Walker 05/28/2013
 
 
Close
loading
Please Confirm
Close