For what it's worth, there's already free code to provide an sql interface on flat file (for example: comma separated). So with relatively little work, we could also have an sql interface on dpkg's current implementation. Of course, to implement this sanely we'd need the relational structure of dpkg written out and well documented. -- Raul