--- /usr/share/software-center/softwarecenter/db/update.original.py 2010-04-27 20:06:49.000000000 +0300 +++ /usr/share/software-center/softwarecenter/db/update.py 2010-05-16 08:32:18.795655095 +0300 @@ -24,6 +24,7 @@ import os import sys import xapian +import string from ConfigParser import RawConfigParser, NoOptionError from glob import glob @@ -93,6 +94,12 @@ w = globals()["WEIGHT_DESKTOP_NAME"] term_generator.index_text_without_positions(name, w) +def ascii_upper(key): + ascii_trans_table = string.maketrans(string.ascii_lowercase, + string.ascii_uppercase) + key_upper = key.translate(ascii_trans_table) + return key_upper + def update(db, cache, datadir=APP_INSTALL_PATH): " index the desktop files in $datadir/desktop/*.desktop " term_generator = xapian.TermGenerator() @@ -193,7 +200,7 @@ if not parser.has_option_desktop(key): continue s = parser.get_desktop(key) - w = globals()["WEIGHT_DESKTOP_"+key.replace(" ","").upper()] + w = globals()["WEIGHT_DESKTOP_"+ ascii_upper(key.replace(" ",""))] term_generator.index_text_without_positions(s, w) # add data from the apt cache if pkgname in cache and cache[pkgname].candidate: