The ara package
---------------
This package is Debian specific since it needs Debian package management
system to operate. Therefore it is a native debian source package.


The package database
--------------------
The package database lives, by default, as text files in

/var/lib/dpkg/available
/var/lib/apt/lists/*_Packages
/var/lib/apt/lists/*_Sources
/var/lib/dpkg/status
					  
It can list everything, installed or not, that are known to the files
mentioned above. Note, that there are some fields used in _Release file, 
but these are not processed yet.

If you have packages installed from multiple Debian suites (stable, testing, 
unstable) and/or from any unofficial repositories ara will see them too,
since they would leave traces in the above mentioned files.

In short, it is your own system what you perform queries on, so what 
you get as query results depends on what you have already put into it. 


Some simple, but interesting examples
-------------------------------------

* How many fields are currently known by your Debian 
Package management System (hold your breath):

ara -fields '*' -table 'source://' | head -2 | tail -1 | \
perl -ne 'for (split/\s|\s/) {print("$_\n") if (/^\w/)}'

As you already know the fields (columns) known by the database, 
you can use them to perform complex queries.

* Native packages we have:

ara -fields Package,Version -table '!version:/\-/'

* NMUed packages, i.e. having X.Y as debian revision

ara -fields Package,Version -table 'version:/\-[0-9]\.[0-9]$/'

* How many packages are Dm-Upload-Allowed:

ara -fields Package,Maintainer -table 'Dm-Upload-Allowed:/yes/i'

* Dm-Upload-Allowed and being NMUed:

ara -fields Package,Version -table 'version:/\-[0-9]\.[0-9]$/ and Dm-Upload-Allowed:/yes/i'

* Packages based on $VCS snapshots:

ara -fields Package,Version -table 'version:(cvs|svn|git|hg|mtn)'

* Projects hosted at *.debian.org

ara -fields Package,Version,Homepage -table 'homepage:/debian.org/'

* Fun with versions ;-)

ara -fields Package,Version -table 'version:/^[3-9][0-9][0-9][0-9][0-9][0-9]/ or version:/unoff/'

* required+important_binary
ara -fields Package:18,Version:14,Priority:9,Filename -table 'priority:(required|important)'

* main_binary
ara -fields Package:18,Version:14,Priority:9,Filename -table 'Filename:/^pool\/main/' \


See also
--------
http://udd.debian.org


 -- George Danchev <danchev@spnet.net>, Sun,  3 Apr 2011 10:17:23 +0300
