From 4f8586a622f7491f595925fc5040a8b545b3aa47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 2 Jun 2006 07:32:51 +0000 Subject: [PATCH] fix: make symlinks updated... --- pisi/archive.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pisi/archive.py b/pisi/archive.py index f5e903da..aa542b9b 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -113,9 +113,13 @@ class ArchiveTar(ArchiveBase): # # Also, tar.extract() doesn't write on symlinks... Not any # more :). - if self.file_path == install_tar_path and os.path.exists(tarinfo.name) \ - and not os.path.isdir(tarinfo.name): - os.unlink(tarinfo.name) + if self.file_path == install_tar_path: + if os.path.isfile(tarinfo.name) or os.path.islink(tarinfo.name): + try: + os.unlink(tarinfo.name) + except OSError, e: + ctx.ui.warning(e) + self.tar.extract(tarinfo) os.chdir(oldwd)