Hi Karen,

usr/src/cmd/system-config/profile/system_info.py:
----------------------------------------------------------------

 217     def determine_terminal_type():
 218         '''Determine default value for terminal type from type
 219         of running environment.
 220         Use following algorithm:
 221          - If connected to SPARC via keyboard/monitor, use "sun"
 222          - If connected to X86 via keyboard/monitor, use "sun-color"
 223          - If connected to X86 and console devprop is not set, use 
"sun-color"
 224          - If running on serial console, use "vt100"
 225          - Otherwise, use "vt100"'''


The description of the algorithm doesn't match that of the actual algorithm,
which to me now looks more like:
 if X86 keyboard & monitor:
    "sun-color"
 if SPARC keyboard & monitor:
    "sun"
 otherwise:
    "vt100"

 233         if platform.processor() == "i386":
 234             if console_type != SERIAL_CONSOLE:
 235                 term_type = "sun-color"
 236         else:
 237             # SPARC
 238             if console_type == PHYSICAL_CONSOLE:
 239                 term_type = "sun"

You're testing essentially the same thing but using inverted logic and different values to do this, which
makes the code a bit harder to follow.
How about switching the i386 case at line 234 to:

234             if console_type == PHYSICAL_CONSOLE:

----------------------------------------------------------------

usr/src/cmd/text-install/__init__.py:
----------------------------------------------------------------


  51 # Defined here to avoid circular import errors
  52 #_ = gettext.translation("textinstall", "/usr/share/locale",
  53 #                        fallback=True).ugettext
  54 _ = gettext.translation("textinstall", "/tmp/locale",

 302     #gettext.install("textinstall", "/usr/share/locale", unicode=True)
 303     gettext.install("textinstall", "/tmp/locale", unicode=True)

"/tmp/locale" seems like an unusual place to be looking for message translation 
files.
Is this the expected location? And why are the old values commented out instead 
of removed?

Otheriwse, looks good to me.

Cheers,
Nial





On 07/21/11 02:42 PM, Karen Tung wrote:
Please review my changes for the following 2 bugs:

6985652  <http://monaco.us.oracle.com/detail.jsf?cr=6985652>  changes in text 
installer iso image for safe provision of localization without garbled display
7068464  <http://monaco.us.oracle.com/detail.jsf?cr=7068464>  
determine_terminal_type() function in sysconfig.profile.system_info doesn't work in 
some cases

webrev:

https://cr.opensolaris.org/action/browse/caiman/ktung/locale_bugs/webrev/

Takeshi from the localization team tested and verified the changes work as expected.

The changes made to network_info.py is not related to these 2 bugs. It's a couple
of pep8 errors that I saw and fixed.

Thanks,

--Karen


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

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

Reply via email to