I want to list all packages of the form
$ dpkg -l libav\*
but in addition to this output, I would like the origin/source (I'm not sure of the preferred term) of each package. If the package doesn't correspond to any source, it should say unknown or similar. Off the top of my head, the most promising approach would be to use dctrl-tools, but I'm not sure how to go about it. For background, I was trying to debug a library mismatch with ffmpeg. See Debian bug report - ffmpeg: backport of 4:0.6.1-5 from unstable produces WARNING: library configuration mismatch. The bug report is no longer an issue, but I'm still interested in this question.
Just to be clear on the format, this should look something like
ii libavahi-client-dev 0.6.27-2+squeeze1 Development files for the Avahi client library squeeze ii libavcodec-dev 4:0.6.1-5 Development files for libavcodec unstable
If the same package is available in multiple categories, ie. in both squeeze and testing, then the lowest / oldest category available should be used. In this case, squeeze.