| 14171 | Bug #283223 - Don't call str() inside _db_escape_string(), |
| zmedico | since it's redundant and it can trigger a |
| | UnicodeEncodeError in python-2.x. |
| 14172 | Bug #283223 - Don't call str() on unicode strings inside |
| zmedico | _db_escape_string(), since it can trigger a |
| | UnicodeEncodeError in python-2.x. |
| 14173 | Fix broken indentation from previous commits. |
| zmedico | |
| 14174 | Bug #283292 - Fix FindPortdir() to prevent OSError: [Errno |
| zmedico | 2] from stat when $PWD is unset. Thanks to Jonathan Callen |
| | <en.ABCD@gmail.com> for this patch. |
| 14175 | Add dev-util/gperf to list of suspected run-time |
| arfrever | dependencies (bug #283357). |
| 14176 | Remove reference to GRP_STAGE23_USE (bug #283358). |
| arfrever | |
svn path=/main/branches/prefix/; revision=14178
"dev-util/byacc",
"dev-util/cmake",
"dev-util/ftjam",
+ "dev-util/gperf",
"dev-util/gtk-doc",
"dev-util/gtk-doc-am",
"dev-util/intltool",
.TP
.BR STAGE1_USE
Special USE flags which may be needed when bootstrapping from stage1 to stage2.
-.TP
-.BR GRP_STAGE23_USE
-Special USE flags used by catalyst for building a stage3 and GRP sets.
.RE
.PD 1
.TP
def _db_escape_string(self, s):
"""meta escaping, returns quoted string for use in sql statements"""
+ if not isinstance(s, basestring):
+ # Avoid potential UnicodeEncodeError in python-2.x by
+ # only calling str() when it's absolutely necessary.
+ s = str(s)
# This is equivalent to the _quote function from pysqlite 1.1.
- return "'%s'" % str(s).replace("'","''")
+ return "'%s'" % s.replace("'", "''")
def _db_init_connection(self, config):
self._dbpath = self.location + ".sqlite"
portdir_overlay = None
location = os.getcwd()
pwd = os.environ.get('PWD', '')
- if pwd != location and os.path.realpath(pwd) == location:
+ if pwd and pwd != location and os.path.realpath(pwd) == location:
# getcwd() returns the canonical path but that makes it hard for repoman to
# orient itself if the user has symlinks in their portage tree structure.
# We use os.environ["PWD"], if available, to get the non-canonical path of