summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2011-03-21 16:30:25 +0100
committerMichael Vogt <mvo@debian.org>2011-03-21 16:30:25 +0100
commitd902f6e33493be74d7908b859d6272a7892f635c (patch)
treea4f1112cffd64ee0cae978d636854b5bbb98e8ad /python
parente3ebbfe848d3d03baaf969374ac55641873bb798 (diff)
downloadpython-apt-d902f6e33493be74d7908b859d6272a7892f635c.tar.gz
* python/arfile.cc, apt/debfile.py:
- add support for .xz archives * tests/test_debfile.py: - add test for xz compression
Diffstat (limited to 'python')
-rw-r--r--python/arfile.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/python/arfile.cc b/python/arfile.cc
index a279807d..5377ca8d 100644
--- a/python/arfile.cc
+++ b/python/arfile.cc
@@ -477,8 +477,8 @@ PyTypeObject PyArArchive_Type = {
* Representation of a Debian package.
*
* This does not resemble debDebFile in apt-inst, but instead is a subclass
- * of ArFile which adds properties for the control.tar.{lzma,bz2,gz} and
- * data.tar.{lzma,bz2,gz} members which return TarFile objects. It also adds
+ * of ArFile which adds properties for the control.tar.{xz,lzma,bz2,gz} and
+ * data.tar.{xz,lzma,bz2,gz} members which return TarFile objects. It also adds
* a descriptor 'version' which returns the content of 'debian-binary'.
*
* We are using it this way as it seems more natural to represent this special
@@ -541,8 +541,12 @@ static PyObject *debfile_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self->data = _gettar(self, self->Object->FindMember("data.tar.lzma"),
"lzma");
if (!self->data)
+ self->data = _gettar(self, self->Object->FindMember("data.tar.xz"),
+ "xz");
+ if (!self->data)
return PyErr_Format(PyExc_SystemError, "No debian archive, missing %s",
- "data.tar.gz or data.tar.bz2 or data.tar.lzma");
+ "data.tar.gz or data.tar.bz2 or data.tar.lzma "
+ "or data.tar.xz");
const ARArchive::Member *member = self->Object->FindMember("debian-binary");
@@ -586,7 +590,7 @@ static PyGetSetDef debfile_getset[] = {
{"control",(getter)debfile_get_control,0,
"The TarFile object associated with the control.tar.gz member."},
{"data",(getter)debfile_get_data,0,
- "The TarFile object associated with the data.tar.{gz,bz2,lzma} member."},
+ "The TarFile object associated with the data.tar.{gz,bz2,lzma,xz}) member."},
{"debian_binary",(getter)debfile_get_debian_binary,0,
"The package version, as contained in debian-binary."},
{NULL}
@@ -600,7 +604,7 @@ static const char *debfile_doc =
"specifying a file descriptor (returned by e.g. os.open()).\n"
"The recommended way of using it is to pass in the path to the file.\n\n"
"It differs from ArArchive by providing the members 'control', 'data'\n"
- "and 'version' for accessing the control.tar.gz, data.tar.{gz,bz2,lzma},\n"
+ "and 'version' for accessing the control.tar.gz, data.tar.{gz,bz2,lzma,xz},\n"
"and debian-binary members in the archive.";
PyTypeObject PyDebFile_Type = {