From 9a17fe0ec09887d800f779790d9af95a15b00ffe Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Tue, 20 Jan 2009 07:42:47 +0000 Subject: [PATCH] new_path should be deleted. If it is a regular file copy works on it, but if it is a symlink as seen on virtualbox delta package, it becomes a problem. --- pisi/atomicoperations.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 6624d1f8..e596abe7 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -337,9 +337,11 @@ class Install(AtomicOperation): if not os.path.exists(destdir): os.makedirs(destdir) - if os.path.islink(old_path): - if not os.path.lexists(new_path): - os.symlink(os.readlink(old_path), new_path) + if os.path.lexists(new_path): + os.unlink(new_path) + + if os.path.islink(old_path): + os.symlink(os.readlink(old_path), new_path) else: shutil.copy(old_path, new_path)