This commit is contained in:
Joshua Harlow
2012-03-01 12:54:26 -08:00
parent d59c13b575
commit a1f4c21e01
2 changed files with 6 additions and 5 deletions

View File

@@ -344,7 +344,7 @@ class PkgUninstallComponent(ComponentBase):
dirsmade = [sh.abspth(d) for d in dirsmade]
if self.keep_old:
olddirs = list(dirsmade)
downloads = self.tracereader.downloaded()
downloads = set(self.tracereader.downloaded())
LOG.info("Attempting to keep %s download directories" % (len(downloads)))
for info in downloads:
download_place = info['target']

View File

@@ -272,6 +272,8 @@ def _explode_path(path):
while path != ROOT_PATH:
(path, name) = os.path.split(path)
parts.append(name)
print path
print name
if path == ROOT_PATH:
parts.append(path)
parts.reverse()
@@ -281,10 +283,9 @@ def _explode_path(path):
def remove_parents(child_path, paths):
if not paths:
return list()
paths = [abspth(p) for p in paths]
paths = [_explode_path(p) for p in paths]
child_path = abspth(child_path)
child_path = _explode_path(child_path)
cleaned_paths = [abspth(p) for p in paths]
paths = [_explode_path(p) for p in cleaned_paths]
child_path = _explode_path(abspth(child_path))
new_paths = list()
for p in paths:
if _array_begins_with(p, child_path):