[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ITP: dpkg-python



On 9 Sep 2000, Milan Zamazal wrote:

> Unless anybody else is interested, I plan to pick up the Python part of
> dpkg-scriptlib and make it a separate (and maintained:-) package.  I

You may want to just let it die.. I have finished the first half of my
work on making a python-apt wrapper which includes at least these modules
from scriptlib:

  ar (*)
  tar (*)
  dpkg_index (afaik, though I'm not sure what it is used for)
  dpkg_message
  dpkg_newformat
  dpkg_packages
  dpkg_util (md5 like there is built in)
  dpkg_version 
* - Only a small portion right now (most useful..), but
    more will come as the need arises
Being a simple wrapper around libapt-pkg all of the above are quite fast, 
and very well tested..

I did not set out to implement dpkg-scriptlib (this is just a weird
coincidence that it overlaps so much) so the names and signatures are
different, but a little compatibility layer would be trivial to add. 

The following are dead remains of an old project that never took off
(I think):
  dpkg_certdb
  dpkg_certificate
  dpkg_certserver
  dpkg_debsums
  dpkg_filedb
  dpkg_lint
  dpkg_log
  dpkg_oldformat (this is just really really old)
  dpkg_verify

And this are support for stuff of the above..
  filter
  outstr
  strfile
  subfile

The pgp stuff is dead pretty much, gpg is the program of choice and I have
a nice module for using it in my LDAP stuff (if anyone wants it).

Here is a simple example for some of the functions:
>>> import apt_pkg,apt_inst;
>>> Foo = apt_pkg.ParseSection(apt_inst.debExtractControl(open("/tmp/dpkg-python_0.1-3.0.deb","r")))
>>> print Foo.keys()
['Package', 'Version', 'Section', 'Priority', 'Architecture', 'Depends',
'Installed-Size', 'Maintainer', 'Description', 'Source']
>>> print apt_pkg.ParseDepends(Foo["Depends"]);
[[('python-base', '1.5-1', '>=')], [('dpkg', '1.4.0.8', '>=')]]
>>> print apt_pkg.RewriteSection(Foo,apt_pkg.RewritePackageOrder,[]);
Package: dpkg-python
Priority: extra
Section: devel
Installed-Size: 93
Maintainer: Debian QA Group <debian-qa@debian.org>
Source: dpkg-scriptlib
Version: 0.1-3.0
Depends: python-base (>= 1.5-1), dpkg (>= 1.4.0.8)
Architecture: all
Description: Python interface modules for dpkg
 Contains Python modules for dpkg, the Debian package management
 system.  These are currently skeletal, but should eventually provide
 access to all low-level dpkg functions from within python, as well as
 a number of higher-level routines.
 
Jason



Reply to: