From c9a883c8ea33f21a42049f833df9cf709a5af7c2 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 13 Dec 2004 08:30:59 +0000 Subject: * Update to work with apt 0.5.32 (bzip2 deb support) Author: mdz Date: 2004-12-12 17:55:54 GMT * Update to work with apt 0.5.32 (bzip2 deb support) --- python/tar.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/tar.cc b/python/tar.cc index f1dd7c31..38844a75 100644 --- a/python/tar.cc +++ b/python/tar.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: tar.cc,v 1.3 2002/02/07 03:35:26 jgg Exp $ +// $Id: tar.cc,v 1.4 2004/12/12 17:55:54 mdz Exp $ /* ###################################################################### Tar Inteface @@ -110,7 +110,7 @@ PyObject *tarExtract(PyObject *Self,PyObject *Args) { // Open the file and associate the tar FileFd Fd(fileno(PyFile_AsFile(File)),false); - ExtractTar Tar(Fd,0xFFFFFFFF); + ExtractTar Tar(Fd,0xFFFFFFFF,Comp); if (_error->PendingError() == true) return HandleErrors(); @@ -137,6 +137,7 @@ PyObject *debExtract(PyObject *Self,PyObject *Args) PyObject *File; PyObject *Function; char *Chunk; + const char *Comp = "gzip"; if (PyArg_ParseTuple(Args,"O!Os",&PyFile_Type,&File, &Function,&Chunk) == 0) @@ -165,7 +166,9 @@ PyObject *debExtract(PyObject *Self,PyObject *Args) } // Extract it. - ExtractTar Tar(Deb.GetFile(),Member->Size); + if (strcmp(".bz2", &Chunk[strlen(Chunk)-4]) == 0) + Comp = "bzip2"; + ExtractTar Tar(Deb.GetFile(),Member->Size,Comp); ProcessTar Proc(Function); if (Tar.Go(Proc) == false) return HandleErrors(); -- cgit v1.2.3