diff --git a/libraries/databaseTools.py b/libraries/databaseTools.py index 387f7e1a0..80432c710 100644 --- a/libraries/databaseTools.py +++ b/libraries/databaseTools.py @@ -518,7 +518,7 @@ class etpDatabase: etpData['conflicts'], etpData['etpapi'], etpData['datecreation'], - revision + revision, ) ) self.commitChanges() diff --git a/libraries/entropyConstants.py b/libraries/entropyConstants.py index 46463f09c..4c14826e9 100644 --- a/libraries/entropyConstants.py +++ b/libraries/entropyConstants.py @@ -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 diff --git a/libraries/reagentTools.py b/libraries/reagentTools.py index 8320917d8..e39b33287 100644 --- a/libraries/reagentTools.py +++ b/libraries/reagentTools.py @@ -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'] = ""