[antlr-interest] expr for package dependencies

hanasaki hanasaki at hanaden.com
Wed Jan 19 12:13:55 PST 2005

Been looking at the way package dependencies are shown and used.  An 
example from a Debian Linux system is shown below.

Parsing the expression isn't a big deal.  I am interested in how folks 
would represent what is parsed to determine the below.  This is more 
related to consuming the parsed info than actual parsing so please 
excuse it being semiOffTopic.

does one build a db/rdbms out of the Packages.gz (this file contains 
multiple text entries like the one shown below) that apt-get (the that 
interprets package info and determines what gets upgraded and / or 
conflicts) gets?

how are the "and/or" and version >=, > ... consumed, recursively? to 
determine requested packageA needs packageB and C and B needs D and 
maybe even D conflicts with A?


=== example from debian ====
Package: abiword-common
Priority: optional
Section: editors
Installed-Size: 2344
Maintainer: Masayuki Hatta <mhatta at debian.org>
Architecture: i386
Source: abiword
Version: 1.0.2+cvs.2002.06.05-1woody2
Replaces: abisuite, abiword-xml, abiword-expat, abiword (<< 0.99.2)
Depends: libc6 (>= 2.2.4-4), debconf, defoma (>= 0.10.2), gsfonts (>= 
6.0-2), libpspell-ispell1 | aspell-dictionary | aspell-en | aspell-da | 
aspell-de | aspell-es | aspell-fo | aspell-fr | aspell-no | aspell-pt, 
psfontmgr, xbase-clients
Recommends: abiword-gtk | abiword-gnome, abiword-doc, abiword-plugins, 
xfonts-abi, x-ttcidfont-conf
Suggests: xfs
Conflicts: abi-fonts, abisuite, abiword-xml, abiword-expat, abiword (<< 
0.99.2), abiword-doc (<< 1.0.2)
Size: 533908
MD5sum: f3d4e7035c0d0e9fcf6c53386f9305f6
Description: WYSIWYG word processor
  AbiWord is the first application of a complete, open source office
  suite. The upstream source includes cross-platform support for Win32,
  BeOS, and QNX as well as GTK+ on Unix.
  AbiWord is still being developed. It's quite usable but not yet full-
  featured or polished. For many applications, however, it should prove
  effective and efficient.
  This program includes support for reading Microsoft Word files,
  RTF files, and many other foreign file formats. Natively, it uses a
  custom XML-based file format.

More information about the antlr-interest mailing list