deb822: support for "parsed" dependencies

Stefano Zacchiroli zack at debian.org
Thu Jun 19 14:08:37 UTC 2008


Right now, with deb822 dependencies (better and more generally: inter
package dependencies) are returned only as string. I would like to
extend this so that there is a way to access "parsed" dependencies
according to the semantics defined in the policy.

Hence I've implemented it, the code is in the "deb822deps" branch of a
personal repository of mine available at:
git+ssh://git.debian.org/git/users/zack/python-debian.git (not yet
visible as gitweb, will be soon).
[ By the way, if you prefer me to push the branch directly on our
repository, let me know. Not *merging*, only pushing to ease code
review. ]

Basically what I did is:
- add the needed parsing code, which basically returns dependencies in
  CNF (Conjunctive Normal Form) together with extra info such as
  versioned deps and arch specific deps
- create a mixin class which can be mixed with sub-classes of Deb822 as
  needed. The class does *not* change what is returned when accessing as
  pkg['depends'], but rather adds a .depends() method if the 'depends'
  key is there. Some goes for the other package relationship fields of
  course
- mixed the mixin class with deb822.Sources and deb822.Packages. The set
  of fields that can be accessed in parsed form is specific of each
  class (e.g. you have "build_depends" for Sources, but not for
  Packages; the other way around for "recommends")

As an interactive top-level s

A doubt I have is if it is a good idea to have top-level methods (as in
pkg.depends(), pkg.recommends(), ...) or if it would be better to have a
wrapper for that (as in pkg.rels['depends'] , pkg.rels['recommends'],
...). Suggestions?

Comments?

In case there are none I'll push/merge to master in a week or so.

Cheers.

-- 
Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
I'm still an SGML person,this newfangled /\ All one has to do is hit the
XML stuff is so ... simplistic  -- Manoj \/ right keys at the right time
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-python-debian-discuss/attachments/20080619/be441aff/attachment.pgp 


More information about the pkg-python-debian-discuss mailing list