if not hasattr(pkg, "getcontents"):
pkg = self._dblink(pkg)
root = self.root
+ if not isinstance(root, unicode):
+ root = unicode(root, encoding='utf_8', errors='replace')
root_len = len(root) - 1
new_contents = pkg.getcontents().copy()
removed = 0
for filename in paths:
+ if not isinstance(filename, unicode):
+ filename = unicode(filename,
+ encoding='utf_8', errors='replace')
filename = normalize_path(filename)
if relative_paths:
relative_filename = filename
if the file is not owned by this package.
"""
+ if not isinstance(filename, unicode):
+ filename = unicode(filename,
+ encoding='utf_8', errors='replace')
+
+ if not isinstance(destroot, unicode):
+ destroot = unicode(destroot,
+ encoding='utf_8', errors='replace')
+
destfile = normalize_path(
os.path.join(destroot, filename.lstrip(os.path.sep)))
new_contents = self.getcontents().copy()
old_contents = self._installed_instance.getcontents()
for f in sorted(preserve_paths):
+ if not isinstance(f, unicode):
+ f = unicode(f, encoding='utf_8', errors='replace')
f_abs = os.path.join(root, f.lstrip(os.sep))
contents_entry = old_contents.get(f_abs)
if contents_entry is None:
mydest = join(destroot, offset, x)
# myrealdest is mydest without the $ROOT prefix (makes a difference if ROOT!="/")
myrealdest = join(sep, offset, x)
+ if not isinstance(myrealdest, unicode):
+ myrealdest = unicode(myrealdest,
+ encoding='utf_8', errors='replace')
# stat file once, test using S_* macros many times (faster that way)
mystat = os.lstat(mysrc)
mymode = mystat[stat.ST_MODE]