Another ungoogleable question means it’s time to ask the Lazy Web again. Sometimes I wish that I could tell google what is the object and what is the subject.
Before I reinvent the wheel, does anybody know of a python module to unpack and parse debian packages, putting the information (such as the stuff in the control file) into a python object?
A quick google with “python”, “libapt”, “dpkg” leads to the possibly useful:
http://packages.debian.org/cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=python-apt
http://www.wiggy.net/code/python-dpkg/
Good luck!
Please install python-apt on a current debian/ubuntu system and have a look at /usr/share/doc/python-apt/examples/deb_inspect.py for example usage. I will be happy to help you (irc/mail) :)
Extract, the python binding to libextractor, is enable to extract informations about a deb file:
http://cheeseshop.python.org/pypi/Extractor
Package: python-apt
Priority: optional
Section: python
Installed-Size: 116
Maintainer: APT Development Team
Architecture: all
Version: 0.6.16.2ubuntu8
Depends: python2.4-apt, python (= 2.4)
Filename: pool/main/p/python-apt/python-apt_0.6.16.2ubuntu8_all.deb
Size: 15374
MD5sum: 0d721e6e58a5a08ed7f5f043ea6c6efb
Description: Python interface to libapt-pkg
The apt-pkg Python interface will provide full access to the internal
libapt-pkg structures allowing Python programs to easily perform a
variety of functions, such as:
.
– Access to the APT configuration system
– Access to the APT package information database
– Parsing of Debian package control files, and other files with a
similar structure
Bugs: mailto:ubuntu-users@lists.ubuntu.com
Origin: Ubuntu
Task: ubuntu-desktop, kubuntu-desktop, edubuntu-desktop, xubuntu-desktop