diff --git a/pisi/archive.py b/pisi/archive.py index 8d30da72..e3e03fca 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -84,11 +84,11 @@ class ArchiveZip(ArchiveBase): buff.close() zip.close() - def unpack_file(self, path, targetDir): - unpack_file(self, lambda f:f==path, targetDir) + def unpack_files(self, paths, targetDir): + self.unpack_file_cond(self, lambda f:f in paths, targetDir) def unpack_dir(self, path, targetDir): - unpack_file(self, lambda f:util.subpath(path,f), targetDir) + self.unpack_file_cond(self, lambda f:util.subpath(path,f), targetDir) def unpack(self, targetDir): super(ArchiveZip, self).unpack(targetDir) @@ -140,5 +140,5 @@ class Archive: def unpack(self, targetDir): self.archive.unpack(targetDir) - def unpack_file(self, targetDir): - self.archive.unpack(targetDir) + def unpack_files(self, files, targetDir): + self.archive.unpack_files(files, targetDir) diff --git a/tests/archivetests.py b/tests/archivetests.py index 6f45224e..8b59d5c7 100644 --- a/tests/archivetests.py +++ b/tests/archivetests.py @@ -73,7 +73,7 @@ class ArchiveFileTestCase(unittest.TestCase): fileName = os.path.basename(ctx.spec.source.archiveUri) filePath = ctx.archives_dir() + '/' + fileName achv = archive.Archive(filePath, ctx.spec.source.archiveType) - achv.unpack_file("sandbox/borek.cd") + achv.unpack_files(["sandbox/borek.cd"], targetDir) assert pathexists(targetDir + "/sandbox") testfile = targetDir + "/sandbox/borek.cs" assert pathexists(testfile)