summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-12-13 08:30:59 +0000
committerArch Librarian <arch@canonical.com>2004-12-13 08:30:59 +0000
commitc9a883c8ea33f21a42049f833df9cf709a5af7c2 (patch)
tree292b16dced93b97e869f1e0608cbe82a1458b6de /python
parent9c3f5f41a7dc01f759c7476ab7e5a6abcb3527ee (diff)
downloadpython-apt-c9a883c8ea33f21a42049f833df9cf709a5af7c2.tar.gz
* 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)
Diffstat (limited to 'python')
-rw-r--r--python/tar.cc9
1 files changed, 6 insertions, 3 deletions
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();