[vox-tech] extracting more deb package info

Ken Bloom vox-tech@lists.lugod.org
Thu, 22 Jan 2004 07:55:32 -0800


--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jan 22, 2004 at 12:44:46AM -0800, Charles McLaughlin wrote:
> I installed Debian via Morhpix (like Knoppix, but I choose a Gnome
> version).  Now my wireless card finally works... whooohooo!
>=20
> Anyway...  The install came with some "experimental" packages that made it
> hard for me to use apt-get.  I kept have dependency problems.  I've gotten
> rid of most of these expermental packages by downgrading to their
> equivalent in the testing distribution.
>=20
> I'd like to know if I have any more of these experimental packages left on
> my system...
>=20
> Is their a way to print out a list of all the packages I have
> installed with an indication of which distribution the package came from?
>=20
> I found dpkg -l, but that doesn't give me enough info.
>=20
> Thanks for any suggestions.

Try out this perl script I created when I was running a mixed box to
see what I had that came from unstable and what came from testing.
(now I just use straight sid)


#!/usr/bin/perl -w

$started=3D0;
@policies=3D`dpkg --get-selections | grep -v deinstall | cut -f 1 | xargs a=
pt-cache policy`;
foreach $x ( @policies ) {
  if ($x =3D~ /^[a-z]/){ #matches lines with package names
    if ($started=3D=3D1) { #print last package info
      print $instdist;
      print "\n";
    }
    chomp $x;  #first *chomp* off a newline
    chop $x;   #then *chop* off a colon
    print $x;
    print '/';
    $started=3D1;
    $instversion=3D0;
    $instdist=3D"unknown";
  }
  if ($x =3D~ /[0-9]+\.[0-9]+/) {$instversion=3D0;} #match a version number
  if ($x =3D~ /\*\*\*/ ) {$instversion=3D1;} #match the current version's *=
**
  if ($instversion=3D=3D1 && ($x =3D~ /http/ || $x =3D~ /ftp/)){ #match a u=
rl line
    if ( $x =3D~ / stable/ ) {$instdist=3D"stable";}
    if ( $x =3D~ /testing/ && $instdist ne "stable")
       {$instdist=3D"testing";}
    if ( $x =3D~ /unstable/ && $instdist ne "stable"
         && $instdist ne "testing")
       {$instdist=3D"unstable";}
  }
}

#print again after the last line
print $instdist;
print "\n";

--=20
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
My key was last signed 10/14/2003. If you use GPG *please* see me about=20
signing the key. ***** My computer can't give you viruses by email. ***

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAD/J0lHapveKyytERAqGiAJ90s71ewXVC4858wfbnaD9ZT69eiwCeK0Gz
vxnIBU6iuKJvuRnLhNypJbg=
=qca/
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--