>>>>> "Jason" == Jason Gunthorpe <jgg@ualberta.ca> writes:
Jason> 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
Jason> You may want to just let it die.. I have finished the first
Jason> half of my work on making a python-apt wrapper which
Jason> includes at least these modules from scriptlib:
This looks certainly better than dpkg-python...
Jason> ar (*)
Jason> tar (*)
Jason> dpkg_index (afaik, though I'm not sure what it is used for)
Jason> dpkg_message
Jason> dpkg_newformat
Jason> dpkg_packages
Jason> dpkg_util (md5 like there is built in)
Jason> dpkg_version
Jason> * - Only a small portion right now (most useful..), but
Jason> more will come as the need arises
Jason> Being a simple wrapper around libapt-pkg all of the above
Jason> are quite fast, and very well tested..
But, please rename those dpkg_* modules. I'd like
import apt.version (or even apt.dpkg.version)
lots better than
import apt.dpkg_version
(Underscores are ugly...)
[...]
Jason> 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()
Jason> ['Package', 'Version', 'Section', 'Priority', 'Architecture', 'Depends',
Jason> 'Installed-Size', 'Maintainer', 'Description', 'Source']
>>>> print apt_pkg.ParseDepends(Foo["Depends"]);
Jason> [[('python-base', '1.5-1', '>=')], [('dpkg', '1.4.0.8', '>=')]]
>>>> print apt_pkg.RewriteSection(Foo,apt_pkg.RewritePackageOrder,[]);
Jason> Package: dpkg-python
Jason> Priority: extra
[...]
*Very* nice indeed... now if only we could take a closer look (apt-get
install python-apt, that is ;-)
Bye, J
--
Jürgen A. Erhard juergen.erhard@gmx.net phone: (GERMANY) 0721 27326
My WebHome: http://members.tripod.com/Juergen_Erhard
Internet Movie Database (http://www.imdb.com)
Shah, shah! Ayatollah you so!
Attachment:
pgpXvSCCdf523.pgp
Description: PGP signature