Sometimes, I want to check where my packages come from. apt-show-versions already does a good job, but it tells you from which archive, and not from which site you pulled the package. Moreover, I wanted to tell in which order the distributions matter (a package may be in both unstable and testing, but being in testing is better for me ; a package I could have saved in my local store should be presented as coming from there, even if it comes from unstable or experimental).
Therefore, I wrote my first (real) Python program.
package_origins [options]
- -h|--help
- This help text
- -l|--list
- Just list available distributions
- -c|--count
- Just display package count by origin
- -t|--tabular
- Use tabular output format for origin display
- -C|--columns=integer
- Set the number of columns of the output
- -L|--lines=integer
- Set the maximal number of packages that can be displayed
- -o|--order=string
- Set the order in which packages are in the distributions. This is a space-jointed string of stanzas like alias1=site1/archive1 where alias1 is the display name of a distribution of name archive1 at site1.
The program also reads the origins in the file ~/.package_origins with the same syntax, except that it is one origin per line. Multiple -o options are supported (they are concatenated).
A sample run:
./package_origins -o 'stable=ftp.fr.debian.org/stable testing=ftp.fr.debian.org/testing unstable=ftp.fr.debian.org/unstable experimental=ftp.fr.debian.org/experimental multimedia=www.debian-multimedia.org/unstable' -L 20 --columns 40
,--------------------------------------.
| stable |
`--------------------------------------'
Too many packages (189). Use --tabular or --lines=X (x>=189).
,--------------------------------------.
| testing |
`--------------------------------------'
Too many packages (1529). Use --tabular or --lines=X (x>=1529).
,--------------------------------------.
| unstable |
`--------------------------------------'
Too many packages (317). Use --tabular or --lines=X (x>=317).
,--------------------------------------.
| experimental |
`--------------------------------------'
calendar-google-provider
calendar-timezones enigmail
,--------------------------------------.
| multimedia |
`--------------------------------------'
Too many packages (33). Use --tabular or --lines=X (x>=33).
,--------------------------------------.
| other |
`--------------------------------------'
emacs-snapshot emacs-snapshot-bin-common
emacs-snapshot-common emacs-snapshot-nox
fixkeyboard lipn-archive-keyring
nvidia-kernel-2.6.26-2-amd64
nvidia-kernel-2.6.30-2-amd64
nvidia-kernel-2.6.31-1-amd64
pbuilder-utils rftg rftg-data
,--------------------------------------.
| installed |
`--------------------------------------'
Too many packages (55). Use --tabular or --lines=X (x>=55).