On Sat, Jun 21, 2003 at 09:52:35AM +0400, Nikita V. Youshchenko wrote:
> Here is a script that finds different versions of installed binary packages
> with the same source package name.

it does not take into account removed (deinstalled) packages, where only the
outdated config files are present. 

Attached an ugly quick hack to fix that.

Greetings
Bernd
-- 
  (OO)      -- [EMAIL PROTECTED] --
 ( .. )  [EMAIL PROTECTED],linux.de,debian.org} http://home.pages.de/~eckes/
  o--o     *plush*  2048/93600EFD  [EMAIL PROTECTED]  +497257930613  BE5-RIPE
(O____O)  When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!
#!/bin/bash

cat /var/lib/dpkg/status | awk '
/^Package:/ {
        p=$2
}
/^Status:/ { 
        st[p]=$2
}
/^Source:/ {
        if ($2 in cnt)  {
                cnt[$2]++;
                pkgs[$2] = pkgs[$2] " " p
        } else {
                cnt[$2] = 1
                pkgs[$2] = p
        }
}
/^Version:/ {
        ver[p]=$2
}
END {
        for (s in cnt) {
                n = split(pkgs[s], l)
                for (i = 2; i <= n && ver[l[i]]==ver[l[1]]; i++);
                if (i > n)
                        continue
                
                print("Source: " s)
                for (i = 1; i <= n; i++)
                        print("Binary " l[i] ": " st[l[i]] "ed version " 
ver[l[i]])
                print
        }
}
'

Reply via email to