added a workaround for bad file names in CONTENTS file

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@249 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2007-03-31 10:38:16 +00:00
parent 2c51d2509e
commit ca5c9a52e9
3 changed files with 38 additions and 29 deletions
+1 -1
View File
@@ -518,7 +518,7 @@ class etpDatabase:
etpData['conflicts'],
etpData['etpapi'],
etpData['datecreation'],
revision
revision,
)
)
self.commitChanges()
+25 -25
View File
@@ -30,31 +30,31 @@ import sys
# THIS IS THE KEY PART OF ENTROPY BINARY PACKAGES MANAGEMENT
# DO NOT EDIT THIS UNLESS YOU KNOW WHAT YOU'RE DOING !!
etpData = {
'name': "", # the Package Name
'version': "", # the Package version plus our -etpXX revision
'description': "", # the Package description
'category': "", # the gentoo category
'chost': "", # the CHOST used to compile it
'cflags': "", # CFLAGS used
'cxxflags': "", # CXXFLAGS used
'homepage': "", # home page of the package
'useflags': "", # USE flags used
'license': "", # License adpoted
'keywords': "", # supported ARCHs (by the SRC)
'binkeywords': "", # supported ARCHs (by the BIN)
'branch': "", # package branch location
'download': "", # link to download the binary package
'digest': "", # md5 hash of the .tbz2 package
'sources': "", # link to the sources
'slot': "", # this is filled if the package is slotted
'content': "", # content of the package (files)
'mirrorlinks': "", # =mirror://openoffice|link1|link2|link3
'dependencies': "", # dependencies
'rundependencies': "", # runtime dependencies
'rundependenciesXT': "", # runtime dependencies + version
'conflicts': "", # blockers
'etpapi': "", # Entropy API revision
'datecreation': "" # mtime of the .tbz2 file
'name': u"", # the Package Name
'version': u"", # the Package version plus our -etpXX revision
'description': u"", # the Package description
'category': u"", # the gentoo category
'chost': u"", # the CHOST used to compile it
'cflags': u"", # CFLAGS used
'cxxflags': u"", # CXXFLAGS used
'homepage': u"", # home page of the package
'useflags': u"", # USE flags used
'license': u"", # License adpoted
'keywords': u"", # supported ARCHs (by the SRC)
'binkeywords': u"", # supported ARCHs (by the BIN)
'branch': u"", # package branch location
'download': u"", # link to download the binary package
'digest': u"", # md5 hash of the .tbz2 package
'sources': u"", # link to the sources
'slot': u"", # this is filled if the package is slotted
'content': u"", # content of the package (files)
'mirrorlinks': u"", # =mirror://openoffice|link1|link2|link3
'dependencies': u"", # dependencies
'rundependencies': u"", # runtime dependencies
'rundependenciesXT': u"", # runtime dependencies + version
'conflicts': u"", # blockers
'etpapi': u"", # Entropy API revision
'datecreation': u"" # mtime of the .tbz2 file
}
# Entropy database SQL initialization Schema and data structure
+12 -3
View File
@@ -106,7 +106,7 @@ def extractPkgData(package):
# Clean the variables
for i in etpData:
etpData[i] = ""
etpData[i] = u""
print_info(yellow(" * ")+red("Getting package name/version..."),back = True)
tbz2File = package
@@ -191,9 +191,18 @@ def extractPkgData(package):
for line in content:
line = line.strip().split()
if line[0] == "obj":
outcontent.append(line[1])
outcontent.append(line[1].strip())
import string
etpData['content'] = string.join(outcontent," ")
# filter bad utf-8 chars
_outcontent = []
for i in outcontent:
try:
i.encode("utf-8")
_outcontent.append(i)
except:
pass
outcontent = _outcontent
etpData['content'] = string.join(outcontent," ").encode("utf-8")
except IOError:
etpData['content'] = ""