Debtags and Blends tasks pages

Enrico Zini enrico at enricozini.org
Wed Jan 28 11:17:33 UTC 2009


On Wed, Jan 28, 2009 at 10:12:28AM +0100, Andreas Tille wrote:

> would in turn let us Blends builders profit from DebTaggers work
> and may be we finally reach a state which enables us to trust
> completely in the debtags to generate our metapackages and tasks
> tools.

It all sounds interesting.

I'm not sure you want to completely trust debtags for that, at least not
until something changes in the workflow of tags: at least at the moment
the QA process for tags is not strict enough to prevent small flaws to
creep even in the reviewed tag set.  In the future I would like to be
able to "assign" tags to people or teams, so that either they are the
only ones that can change them, or so that they will qa on their tags
before they are accepted, or a mix of this.  At that point, provided
your tags are assigned to a team, you should be able to trust debtags
for your task.

Also, it may be that you don't need all the packages with a given tag:
for example, you may have two packages doing the same thing, but your
Blend may want one and not the other.


> Privided that you like my suggestions I it would be really helpful
> if you could provide me with the following information:
>    1. Is there a simple Python interface like
>         GetDebTags(<list of packages>)
>           Returns:
>              Dictionary of DebTags, key are the list elements above
>       or something like this which would be useful to add the
>       Debtags to the package information as suggested above

Sure there is:

apt-get install python-debian

  from debian-bundle import debtags
  
  db = debtags.DB()
  db.read(open("/var/lib/debtags/package-tags", "r"))
  tags = db.tagsOfPackages(["pkg1", "pkg2", "pkg3"])
  
>    2. A Python interface that provides any package which
>       has a certain DebTag set:
> 
>         GetPackages(<debtag>)
>           Returns:
>              List of packages which has a certain tag (may be
>              also a list of tags) set.

Same as before, but:

  packages = db.packagesOfTags(["tag1", "tag2", "tag3"])

> If these interfaces exist I might be able to realise my suggestion
> above in the near future (I will spend this weekend in Trindheim at
> the Debian Edu developer gathering and will try to work on things
> like this).

You can find some documentation about the debtags module in
/usr/share/doc/python-debian/README.debtags.gz

There are also other ways, for example to cross debtags data with a full
Xapian text index of package data, and for that you may want to look
into the package apt-xapian-index and its examples.

If you want to download a cross-arch and cross-distro dataset, you may
want to look at the video of my oncoming DDE presentation at FOSDEM.

In the meantime, python-debian should be enough to get you started.


Ciao,

Enrico

-- 
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/debtags-devel/attachments/20090128/4801fe0b/attachment.pgp 


More information about the Debtags-devel mailing list