bugs: smart on fc5

Jeff Johnson n3npq at mac.com
Wed Apr 12 11:21:34 PDT 2006


On Apr 12, 2006, at 10:27 AM, Darko Veberic wrote:

> Gustavo Niemeyer wrote:
>>>                 if hasdescription:
>>>                     desc = info.getDescription()
>>>                     if desc:
>>>                         for pattern in hasdescription:
>>>                             if pattern.search(desc):
>>>                                 newpackages[pkg] = True
>> Are you able to tell why this is needed? The default description is
>> an empty string, which should work fine with the logic currently
>> there.
>
> no, the return from info.getDescription() is None in some cases...  
> but you are right: maybe the info class should return an empty string.
>

Gustavo is saying that there should never be a package w/o a  
description -- and if there is one -- then something else is wrong.
Adding a bandaid like a empty string may keep smart functional, but  
there's a deeper and more fundamental problem that needs
to addressed.

>>>         if self.opts.show_summary:
>>>             info = pkg.loaders.keys()[0].getInfo(pkg)
>>>             print "-", info.getSummary().encode('utf-8')
>> This shouldn't be needed if your terminal is correctly setup either.
>> Smart will convert these strings to the preferred encoding
>> automatically (converting straight to utf-8 would break anyone
>> that doesn't use it).
>
> well that is somehow awkward, don't you think? i have not seen any  
> command-line programs that stop working if your terminal does not  
> have some capability. without .encode() smart info just stops with  
> an error. i know practically nothing about python. i do these  
> changes in order to keep the thing running. maybe smart should look  
> into LC_CTYPE and decide... i am using smart in console and i would  
> like that it works there in the future. gui is just too clumsy...
>
The problem is that rpm data (like description) does not supply a  
clear and unambiguous encoding.

Without a known encoding, a transformation is very tricky, as  
guessing the encoding from a string is not simple.

Unknown encodings for metadata strings is a fundamental design  
problem in rpm, not smart, and needs to be
fixed within rpm. The work to force utf-8 encodings onto all rpm  
metadata is well underway, should be in rpm-4.4.7
final when released.

73 de Jeff




More information about the Smart mailing list