On 10/11/07, Cyril Brulebois <[EMAIL PROTECTED]> wrote:
> Ondrej Certik <[EMAIL PROTECTED]> (11/10/2007):
> > So I don't think this is a broken mix, nor do I think any of them are
> > related to this bug. BTW, do you know some more robust command to list
> > all packages, that don't match the ones in sid (including versions)?
>
> What about combining the output of "dpkg -l"and "apt-cache policy"?

That seems to work, thanks. I assembled the following script, that
prints each suspicious package (either the candidate version doesn't
match the installed version, or the topmost repository is not the
official debian one):

$ cat check.py
#! /usr/bin/env python

import pexpect

pkgs = pexpect.run("wajig list-installed").split("\r\n")
pkgs = [x for x in pkgs if not x == ""]
print "Need to check %d packages." % len(pkgs)
for i,p in enumerate(pkgs):
    policy = pexpect.run("apt-cache policy %s" % p)
    s = policy.split("\r\n")
    installed = s[1][13:]
    candidate = s[1][13:]
    if installed != candidate:
        print policy
    versions = s[4:]
    candidate = versions[1]
    if candidate.find("http://ftp.de.debian.org";) == -1:
        print policy


    if i % 100 == 0:
        print "packages processed:",i+1

$ time ./check.py
Need to check 1449 packages.
packages processed: 1
blzpack-dev:
  Installed: 0.0.20020101.dfsg-0oc1
  Candidate: 0.0.20020101.dfsg-0oc1
  Version table:
 *** 0.0.20020101.dfsg-0oc1 0
        500 http://debian.wgdd.de unstable/main Packages
        100 /var/lib/dpkg/status

blzpack1:
  Installed: 0.0.20020101.dfsg-0oc1
  Candidate: 0.0.20020101.dfsg-0oc1
  Version table:
 *** 0.0.20020101.dfsg-0oc1 0
        500 http://debian.wgdd.de unstable/main Packages
        100 /var/lib/dpkg/status

daniel-archive-keyring:
  Installed: 2007.07.01
  Candidate: 2007.07.01
  Version table:
 *** 2007.07.01 0
        500 http://pc232 unstable/ Packages
        100 /var/lib/dpkg/status

packages processed: 101
packages processed: 201
googleearth:
  Installed: 4.2.180.1134+0.3.2-1
  Candidate: 4.2.180.1134+0.3.2-1
  Version table:
 *** 4.2.180.1134+0.3.2-1 0
        500 http://pc232 unstable/ Packages
        100 /var/lib/dpkg/status
     4.1.7076.4458+0.3.2-1 0
        500 http://pc232 unstable/ Packages

packages processed: 301
packages processed: 401
packages processed: 501
packages processed: 601
packages processed: 701
libsnmp10:
  Installed: 5.3.1-8
  Candidate: 5.3.1-8
  Version table:
 *** 5.3.1-8 0
        100 /var/lib/dpkg/status

packages processed: 801
packages processed: 901
linux-image-2.6.19-rc4r2:
  Installed: 2.6.19-rc4r2-10.00.Custom
  Candidate: 2.6.19-rc4r2-10.00.Custom
  Version table:
 *** 2.6.19-rc4r2-10.00.Custom 0
        100 /var/lib/dpkg/status

linux-image-2.6.20-1-686:
  Installed: 2.6.20-3
  Candidate: 2.6.20-3
  Version table:
 *** 2.6.20-3 0
        100 /var/lib/dpkg/status

linux-image-2.6.20r2:
  Installed: 2.6.20r2-10.00.Custom
  Candidate: 2.6.20r2-10.00.Custom
  Version table:
 *** 2.6.20r2-10.00.Custom 0
        100 /var/lib/dpkg/status

linux-image-2.6.21-1-686:
  Installed: 2.6.21-4
  Candidate: 2.6.21-4
  Version table:
 *** 2.6.21-4 0
        100 /var/lib/dpkg/status

mayavi2:
  Installed: 2.5.1b-1~oc1
  Candidate: 2.5.1b-1~oc1
  Version table:
 *** 2.5.1b-1~oc1 0
        100 /var/lib/dpkg/status
     2.5.1-1~oc1 0
        500 http://debian.wgdd.de unstable/main Packages

packages processed: 1001
ondrej-archive-keyring:
  Installed: 2007.06.24
  Candidate: 2007.06.24
  Version table:
 *** 2007.06.24 0
        500 http://pc232 unstable/ Packages
        100 /var/lib/dpkg/status

packages processed: 1101
python-ets-traits:
  Installed: 2.5.1b-1~oc1
  Candidate: 2.5.1b-1~oc1
  Version table:
 *** 2.5.1b-1~oc1 0
        100 /var/lib/dpkg/status
     2.5.1-1~oc1 0
        500 http://debian.wgdd.de unstable/main Packages

python-ets-traits-ui:
  Installed: 2.5.1b-1~oc1
  Candidate: 2.5.1b-1~oc1
  Version table:
 *** 2.5.1b-1~oc1 0
        100 /var/lib/dpkg/status
     2.5.1-1~oc1 0
        500 http://debian.wgdd.de unstable/main Packages

packages processed: 1201
skype:
  Installed: 1.3.0.53-1
  Candidate: 1.3.0.53-1
  Version table:
 *** 1.3.0.53-1 0
        100 /var/lib/dpkg/status

tivsm-api:
  Installed: 5.3.4-4
  Candidate: 5.3.4-4
  Version table:
 *** 5.3.4-4 0
        100 /var/lib/dpkg/status

tivsm-ba:
  Installed: 5.3.4-4
  Candidate: 5.3.4-4
  Version table:
 *** 5.3.4-4 0
        100 /var/lib/dpkg/status

packages processed: 1301
packages processed: 1401

real    2m49.759s
user    0m10.997s
sys     0m1.524s


It's quite slow though, but seems to work.

Ondrej



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to