From 727ba7964b8e84837bad17e2fd82a976c2113122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Sun, 13 Jun 2010 15:27:30 +0000 Subject: [PATCH] install: Read install.tar.lzma without extracting it Do not waste time/space for extracting it from ZIP archive. --- pisi/package.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pisi/package.py b/pisi/package.py index b63ebac8..9413f604 100644 --- a/pisi/package.py +++ b/pisi/package.py @@ -120,17 +120,12 @@ class Package: if self.impl.has_file(ctx.const.install_tar_lzma): - lzmafile = os.path.join(ctx.config.tmp_dir(), ctx.const.install_tar_lzma) - self.extract_file(ctx.const.install_tar_lzma, ctx.config.tmp_dir()) - tar = archive.ArchiveTar(lzmafile, 'tarlzma', False, False) + lzmafile = self.impl.open(ctx.const.install_tar_lzma) + tar = archive.ArchiveTar(fileobj=lzmafile, + arch_type="tarlzma", + no_same_permissions=False, + no_same_owner=False) tar.unpack_dir(outdir, callback=callback) - - # cleanup install.tar.lzma and install.tar after installing - if os.path.exists(lzmafile): - os.unlink(lzmafile) - lzmafile = util.remove_suffix(ctx.const.lzma_suffix, lzmafile) - if os.path.exists(lzmafile): - os.unlink(lzmafile) else: self.extract_dir_flat('install', outdir)