Fix for issue 131: Installs items with subdirectories in source_item not handled correctly by removeCopiedItems

This commit is contained in:
Greg Neagle
2011-11-22 10:12:35 -08:00
parent bb7f2c8e69
commit e7b2667874
+3 -2
View File
@@ -358,7 +358,8 @@ def copyFromDMG(dmgpath, itemlist):
destpath = item.get("destination_path")
if os.path.exists(destpath):
# remove item if it already exists
olditem = os.path.join(destpath, itemname)
olditem = os.path.join(destpath,
os.path.basename(itemname))
if os.path.exists(olditem):
retcode = subprocess.call(
["/bin/rm", "-rf", olditem])
@@ -474,7 +475,7 @@ def removeCopiedItems(itemlist):
munkicommon.display_error("Missing path for item to remove.")
retcode = -1
break
path_to_remove = os.path.join(destpath, itemname)
path_to_remove = os.path.join(destpath, os.path.basename(itemname))
if os.path.exists(path_to_remove):
munkicommon.display_status('Removing %s' % path_to_remove)
retcode = subprocess.call(['/bin/rm', '-rf', path_to_remove])