Bug#671784: python-apt: debExtractControl gone
On Mon, May 07, 2012 at 02:04:54AM +0200, David Kalnischkies wrote:
> On Sun, May 6, 2012 at 11:56 PM, Ansgar Burchardt <ansgar@debian.org> wrote:
> > debExtractControl is gone from apt_inst. The example still mention
> > deb_extract_control, but that is not there either:
>
> Are you sure about that?
>
> If you mean the debDebFile::MemControlExtract methods, these are still here -
> and are the only once which are referenced by python-apt.
> I am not in to python, but it seems like it provides a debExtractControl
> implemented with the MemControlExtract methods.
Yes, the code is there, but it was deprecated in squeeze, disabled for wheezy,
and only remains in Ubuntu. It has been replaced by a more object-oriented
DebFile, ArArchive, and TarArchive classes; so you can now do
debf = apt_inst.DebFile("mydeb.deb")
cntl = debf.control
data = debf.data
to get the control.tar.*/data.tar.* files as TarFile objects, and then
use something like:
data.extractdata("myfilename")
to extract a file into memory.
Much more flexible, and allows us to use apt_inst instead of
python-debian's debian.debfile module, as their API is roughly
similar.
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Reply to: