Clean up install.tar.lzma and install.tar left in /var/pisi

This commit is contained in:
Faik Uygur
2008-02-07 12:31:20 +00:00
parent 0e3a795bc3
commit 9e61466a19
+9 -1
View File
@@ -86,9 +86,17 @@ class Package:
def extract_install(self, outdir):
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(os.path.join(ctx.config.tmp_dir(), ctx.const.install_tar_lzma), 'tarlzma', False, False)
tar = archive.ArchiveTar(lzmafile, 'tarlzma', False, False)
tar.unpack_dir(outdir)
# cleanup install.tar.lzma and install.tar after installing
if os.path.exists(lzmafile):
os.unlink(lzmafile)
lzmafile = lzmafile.rstrip(ctx.const.lzma_suffix)
if os.path.exists(lzmafile):
os.unlink(lzmafile.rstrip(lzmafile)
else:
self.extract_dir_flat('install', outdir)