From a038fcb986d29ef5b2d579e6449c31556f321ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Tue, 22 Jun 2010 06:12:00 +0000 Subject: [PATCH] archive: Fix ArchiveZip adding empty dirs with incorrect paths --- pisi/archive.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pisi/archive.py b/pisi/archive.py index cdf3a88b..4958a595 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -448,11 +448,12 @@ class ArchiveZip(ArchiveBase): # It's a pity that zipfile can't handle unicode strings. Grrr! file_name = str(file_name) if os.path.isdir(file_name) and not os.path.islink(file_name): - self.zip_obj.writestr(file_name + '/', '') - attr_obj = self.zip_obj.getinfo(file_name + '/') + self.zip_obj.writestr(arc_name + '/', '') + attr_obj = self.zip_obj.getinfo(arc_name + '/') attr_obj.external_attr = stat.S_IMODE(os.stat(file_name)[0]) << 16L for f in os.listdir(file_name): - self.add_to_archive(os.path.join(file_name, f)) + self.add_to_archive(os.path.join(file_name, f), + os.path.join(arc_name, f)) else: if os.path.islink(file_name): dest = os.readlink(file_name)