diff options
-rw-r--r-- | pym/portage/dbapi/vartree.py | 7 | ||||
-rw-r--r-- | pym/portage/package/ebuild/doebuild.py | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index f1e74aef9..4811e60bd 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -3498,6 +3498,8 @@ class dblink(object): # inexpensive since we call os.walk() here anyway). unicode_errors = [] line_ending_re = re.compile('[\n\r]') + srcroot_len = len(srcroot) + ed_len = len(self.settings["ED"]) while True: @@ -3507,7 +3509,6 @@ class dblink(object): myfilelist = [] mylinklist = [] paths_with_newlines = [] - srcroot_len = len(srcroot) def onerror(e): raise walk_iter = os.walk(srcroot, onerror=onerror) @@ -3535,7 +3536,7 @@ class dblink(object): encoding=_encodings['merge'], errors='replace') os.rename(parent, new_parent) unicode_error = True - unicode_errors.append(new_parent[srcroot_len:]) + unicode_errors.append(new_parent[ed_len:]) break for fname in files: @@ -3554,7 +3555,7 @@ class dblink(object): new_fpath = os.path.join(parent, new_fname) os.rename(fpath, new_fpath) unicode_error = True - unicode_errors.append(new_fpath[srcroot_len:]) + unicode_errors.append(new_fpath[ed_len:]) fname = new_fname fpath = new_fpath else: diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 5d2586b0b..31ecf8cdd 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -1689,6 +1689,7 @@ def _post_src_install_uid_fix(mysettings, out): _preinst_bsdflags(mysettings) destdir = mysettings["D"] + ed_len = len(mysettings["ED"]) unicode_errors = [] while True: @@ -1712,7 +1713,7 @@ def _post_src_install_uid_fix(mysettings, out): encoding=_encodings['merge'], errors='replace') os.rename(parent, new_parent) unicode_error = True - unicode_errors.append(new_parent[len(destdir):]) + unicode_errors.append(new_parent[ed_len:]) break for fname in chain(dirs, files): @@ -1731,7 +1732,7 @@ def _post_src_install_uid_fix(mysettings, out): new_fpath = os.path.join(parent, new_fname) os.rename(fpath, new_fpath) unicode_error = True - unicode_errors.append(new_fpath[len(destdir):]) + unicode_errors.append(new_fpath[ed_len:]) fname = new_fname fpath = new_fpath else: |