From 674b58366514a5b0110a86ad2d7fb694de3683b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Wed, 15 Jun 2005 09:14:42 +0000 Subject: [PATCH] =?UTF-8?q?zip=20a=C3=A7ma=20sorunu=20(dosyalar=20yerine?= =?UTF-8?q?=20dizin=20olu=C5=9Fturuluyordu)=20=C3=A7=C3=B6z=C3=BCld=C3=BC.?= =?UTF-8?q?=20Fakat=20sembolik=20linklerde=20halen=20sorun=20var.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pisi/archive.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pisi/archive.py b/src/pisi/archive.py index 91f7bf7c..a72eb874 100644 --- a/src/pisi/archive.py +++ b/src/pisi/archive.py @@ -49,13 +49,20 @@ class ArchiveZip(ArchiveBase): fileNames = zip.namelist() for file in fileNames: ofile = self.targetDir + '/' + file - if not os.path.exists(ofile): + + # a directory is present. lets continue + if os.path.isdir(ofile): + continue + # do we need to create parent directory for our file? + if not os.path.exists(os.path.dirname(ofile)): os.mkdir(ofile) continue + buff = open (ofile, 'wb') fileContent = zip.read(file) buff.write(fileContent) buff.close() + zip.close() class Archive: