trying to cope with license encoding issues
git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1305 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -2501,14 +2501,13 @@ class etpDatabase:
|
||||
licname = licname.strip()
|
||||
if not entropyTools.is_valid_string(licname):
|
||||
continue
|
||||
|
||||
self.connection.text_factory = lambda x: unicode(x, "raw_unicode_escape")
|
||||
|
||||
self.cursor.execute('SELECT text FROM licensedata WHERE licensename = (?)', (licname,))
|
||||
lictext = self.cursor.fetchone()
|
||||
if lictext != None:
|
||||
lictext = lictext[0]
|
||||
if type(lictext) is unicode: # should always be a buffer btw
|
||||
licdata[licname] = lictext
|
||||
else:
|
||||
licdata[licname] = unicode(lictext, "raw_unicode_escape")
|
||||
licdata[licname] = lictext[0]
|
||||
|
||||
self.storeInfoCache(idpackage,'retrieveLicensedata',licdata)
|
||||
return licdata
|
||||
|
||||
@@ -2117,11 +2117,8 @@ def extractPkgData(package, etpBranch = etpConst['branch'], silent = False, inje
|
||||
licfile = os.path.join(licenses_dir,mylicense)
|
||||
if os.access(licfile,os.R_OK):
|
||||
if istextfile(licfile):
|
||||
f = open(licfile,"rb")
|
||||
f.seek(0,2)
|
||||
size = f.tell()
|
||||
f.seek(0)
|
||||
data['licensedata'][mylicense] = f.read(size)
|
||||
f = open(licfile)
|
||||
data['licensedata'][mylicense] = f.read()
|
||||
f.close()
|
||||
|
||||
if not silent: print_info(yellow(" * ")+red(info_package+"Getting package mirrors list..."),back = True)
|
||||
|
||||
Reference in New Issue
Block a user