in amend, remove symlink targets before creating them

amend's symlink command isn't idempotent, so if you restart after the
symlinks have been completed then the second installation attempt will
fail.  Work around this by deleting all symlink targets before
creating symlinks.

Bug: 2020011
This commit is contained in:
Doug Zongker
2009-08-03 14:11:09 -07:00
parent 7ebafd5aa0
commit 828bbfb188

View File

@@ -180,6 +180,7 @@ class AmendGenerator(object):
def MakeSymlinks(self, symlink_list):
"""Create symlinks, given a list of (dest, link) pairs."""
self.DeleteFiles([i[1] for i in symlink_list])
self.script.extend(["symlink %s %s" % (i[0], self._FileRoot(i[1]))
for i in sorted(symlink_list)])