Bug#696655: apt-show-versions lacks multiarch support

2013-06-03 Thread Daniel Dickinson
Package: apt-show-versions
Version: 0.20
Followup-For: Bug #696655

Just wondering of the patches mentioned above can be made available in for 
testin in experimental if they are not already?  (This is basically a me too 
since some devs at least take the number of people commenting on a bug as a 
signal as to how important it is).

-- System Information:
Debian Release: 7.0
  APT prefers stable-updates
  APT policy: (990, 'stable-updates'), (990, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt-show-versions depends on:
ii  apt  0.9.7.8
ii  libapt-pkg-perl  0.1.26+b1
ii  perl [libstorable-perl]  5.14.2-21

apt-show-versions recommends no packages.

apt-show-versions suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#696655: apt-show-versions lacks multiarch support

2013-05-28 Thread Vincent Lefevre
Another example:

xvii:~ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name   Version  Architecture Description
+++-==---=
ii  libc6:amd642.17-3   amd64Embedded GNU C Library: Shared li

xvii:~ apt-show-versions -a libc6:amd64
Not installed
No stable version
No testing version
No unstable version
No experimental version
libc6:amd64 not installed (even not available)

So, the problem is not specific to foreign architectures.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#696655: apt-show-versions lacks multiarch support

2013-05-28 Thread Greg Klanderman
Hi Vincent, does my patch (attached to the bug report) fix the problem?

thanks,
Greg


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#696655: apt-show-versions lacks multiarch support

2013-05-28 Thread Vincent Lefevre
Hi,

On 2013-05-28 15:14:18 -0400, Greg Klanderman wrote:
 Hi Vincent, does my patch (attached to the bug report) fix the problem?

Yes, but with 2 problems:

1. I get a warning on one of my machines (but not the other one):

xvii:~ ./apt-show-versions -a libc6:amd64
Use of uninitialized value in subroutine entry at 
/usr/lib/perl5/AptPkg/Version.pm line 18, FILE line 50.
libc6:amd64 2.17-3 install ok installed
libc6:amd64 2.13-38 wheezy   ftp.debian.org
libc6:amd64 2.17-3  testing  ftp.debian.org
libc6:amd64 2.17-3  unstable ftp.debian.org
No experimental version
libc6:amd64/testing uptodate 2.17-3

xvii:~ ./apt-show-versions -a libc6
Use of uninitialized value in subroutine entry at 
/usr/lib/perl5/AptPkg/Version.pm line 18, FILE line 50.
libc6:amd64 2.17-3 install ok installed
libc6:amd64 2.13-38 wheezy   ftp.debian.org
libc6:amd64 2.17-3  testing  ftp.debian.org
libc6:amd64 2.17-3  unstable ftp.debian.org
No experimental version
libc6:amd64/testing uptodate 2.17-3

ypig:~ ./apt-show-versions -a libc6
libc6:amd64 2.17-3 install ok installed
libc6:amd64 2.13-38 wheezy   ftp.debian.org
libc6:amd64 2.17-3  testing  ftp.debian.org
libc6:amd64 2.17-3  unstable ftp.debian.org
No experimental version
libc6:amd64/testing uptodate 2.17-3
libc6:i386 2.17-3 install ok installed
libc6:i386 2.13-38 wheezy   ftp.debian.org
libc6:i386 2.17-3  testing  ftp.debian.org
libc6:i386 2.17-3  unstable ftp.debian.org
No experimental version
libc6:i386/testing uptodate 2.17-3

2. It is much slower.

xvii:~ time apt-show-versions -a libc6
libc6 2.17-3 install ok installed
libc6 2.13-38 wheezy   ftp.debian.org
libc6 2.17-3  testing  ftp.debian.org
libc6 2.17-3  unstable ftp.debian.org
No experimental version
libc6/testing uptodate 2.17-3
apt-show-versions -a libc6  0.73s user 0.07s system 98% cpu 0.813 total

xvii:~ time ./apt-show-versions -a libc6
Use of uninitialized value in subroutine entry at 
/usr/lib/perl5/AptPkg/Version.pm line 18, FILE line 50.
libc6:amd64 2.17-3 install ok installed
libc6:amd64 2.13-38 wheezy   ftp.debian.org
libc6:amd64 2.17-3  testing  ftp.debian.org
libc6:amd64 2.17-3  unstable ftp.debian.org
No experimental version
libc6:amd64/testing uptodate 2.17-3
./apt-show-versions -a libc6  4.71s user 0.14s system 99% cpu 4.860 total

xvii:~ time ./apt-show-versions -a libc6:amd64
Use of uninitialized value in subroutine entry at 
/usr/lib/perl5/AptPkg/Version.pm line 18, FILE line 50.
libc6:amd64 2.17-3 install ok installed
libc6:amd64 2.13-38 wheezy   ftp.debian.org
libc6:amd64 2.17-3  testing  ftp.debian.org
libc6:amd64 2.17-3  unstable ftp.debian.org
No experimental version
libc6:amd64/testing uptodate 2.17-3
./apt-show-versions -a libc6:amd64  4.66s user 0.17s system 99% cpu 4.850 total

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#696655: apt-show-versions lacks multiarch support

2013-01-24 Thread Gábor Gombás
Package: apt-show-versions
Version: 0.20
Followup-For: Bug #696655

Hi,

The attached patch makes apt-show-versions report information about
packages of foreign architectures correctly. The existing cache files
need to be removed first.

Gabor

-- System Information:
Debian Release: 7.0
  APT prefers stable
  APT policy: (990, 'stable'), (103, 'testing'), (102, 'unstable'), (101, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.7.3 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt-show-versions depends on:
ii  apt  0.9.7.7
ii  libapt-pkg-perl  0.1.26+b1
ii  perl [libstorable-perl]  5.14.2-16

apt-show-versions recommends no packages.

apt-show-versions suggests no packages.

/- no debconf information
--- apt-show-versions.orig	2012-10-26 21:04:26.0 +0200
+++ apt-show-versions	2013-01-24 21:05:37.079635767 +0100
@@ -69,6 +69,7 @@
 my $SUITE= 'Suite';
 my $UNKNOWN  = 'unknown';
 my $VERS = 'Version';
+my $ARCH = 'Architecture';
 
 # process commandline parameters
 my %opts;
@@ -518,6 +519,7 @@
 if (/^$/){
 unless (defined $package) {next};
 
+my $package_arch = $package-{$PACKAGE} . ':' . $package-{$ARCH};
 if ($status) { # Are we parsing the status file?
 # if we did not specify a package or pattern
 # only include installed packages
@@ -525,21 +527,21 @@
 ($package-{$STATUS} =~ /not-installed|config-files/ or
  # don't print holded packages if requested
  ($opts{'nohold'} and $package-{$STATUS} =~ /hold/))) {
-$packages-{ $package-{$PACKAGE}} = $package;
+$packages-{$package_arch} = $package;
 }
 }
 else {
-if (!defined $packages-{$package-{$PACKAGE}} or
-$vs-compare($packages-{$package-{$PACKAGE}}{$VERS},
+if (!defined $packages-{$package_arch} or
+$vs-compare($packages-{$package_arch}{$VERS},
 $package-{$VERS})  0) {
 $package-{$RELEASE} = $release;
-$packages-{$package-{$PACKAGE}} = $package;
+$packages-{$package_arch} = $package;
 }
 }
 undef $package;
 next;
 }
-unless ((/^Package/) || (/^Version/) || (/^Status/) || (/^Source/)) {next};
+unless ((/^Package/) || (/^Version/) || (/^Status/) || (/^Source/) || (/^Architecture/)) {next};
 ($key, $value) = split /: /, $_;
 $value =~ s/\n//;
 $value =~ s/\s\(.*\)$//; # Remove any Version information in ()


Bug#696655: apt-show-versions lacks multiarch support

2013-01-24 Thread Greg Klanderman
 On January 24, 2013 UTF  UTF-8 wrote:

 Hi,

 The attached patch makes apt-show-versions report information about
 packages of foreign architectures correctly. The existing cache files
 need to be removed first.

 Gabor

I don't think that will work right if you specify a package on the
command line.  I've attached the patch I hacked up just this morning.
It uses new names for the cache files so there is no need to remove
the existing ones first.

Greg

Index: apt-show-versions
===
--- apt-show-versions	(revision 2468)
+++ apt-show-versions	(revision 2469)
@@ -36,8 +36,8 @@
 use Getopt::Long;
 use Storable qw(store retrieve);
 
-my $apackagescachefile=/var/cache/apt-show-versions/apackages;
-my $ipackagescachefile=/var/cache/apt-show-versions/ipackages;
+my $apackagescachefile=/var/cache/apt-show-versions/apackages-multiarch;
+my $ipackagescachefile=/var/cache/apt-show-versions/ipackages-multiarch;
 my $filescachefile=/var/cache/apt-show-versions/files;
 
 use AptPkg::Cache;
@@ -69,6 +69,7 @@
 my $SUITE= 'Suite';
 my $UNKNOWN  = 'unknown';
 my $VERS = 'Version';
+my $ARCH = 'Architecture';
 
 # process commandline parameters
 my %opts;
@@ -257,8 +258,10 @@
 if (! -e $apackagescachefile or -C $_  -M $apackagescachefile
 or $cache_file_corrupt) {
 my ($href, $release) = parse_file ($_);
-foreach (keys %$href) {
-$apackages-{$_}{$release} = $href-{$_};
+foreach my $pkg (keys %$href) {
+foreach my $arch (keys $href-{$pkg}) {
+$apackages-{$pkg}{$arch}{$release} = $href-{$pkg}{$arch};
+}
 }
 }
 }
@@ -299,20 +302,20 @@
 #   Version information to be printed (undef if no information exists)
 
 sub print_version {
-my ($archiv, $package, $iversion, $aversion, $cand) = @_;
+my ($archiv, $pkgarch, $iversion, $aversion, $cand) = @_;
 
-if (defined($aversion) and $cache-{$package}) {
+if (defined($aversion) and $cache-{$pkgarch}) {
 if ($cand and $aversion eq $cand-{VerStr})
 {
 my $cmp_versions = $vs-compare($aversion, $iversion);
 if ($cmp_versions != 0) {
 my $direction = ($cmp_versions  0) ? 'up' : 'down';
-return(2, $package/$archiv,
+return(2, $pkgarch/$archiv,
(defined($opts{'brief'})) ? \n :
 ${direction}gradeable from $iversion to $aversion\n);
 }
 else {
-return(1, $package/$archiv, defined($opts{'brief'}) ? \n
+return(1, $pkgarch/$archiv, defined($opts{'brief'}) ? \n
:  uptodate $iversion\n);
 }
 }
@@ -327,8 +330,23 @@
 sub print_package {
 my ($package) = @_;
 
+if ($package =~ m/:/) {
+my ($pkgname, $arch) = split /:/, $package;
+print_package_internal($pkgname, $arch);
+} else {
+my $pkgs = ($opts{'regex-all'}) ? $apackages : $ipackages;
+foreach my $arch (sort keys $pkgs-{$package}) {
+print_package_internal($package, $arch);
+}
+}
+}
+
+sub print_package_internal {
+my ($package, $arch) = @_;
+my $pkgarch = $package . : . $arch;
+
 # Sort all releases of package.
-my @pkg_releases = sort sort_pkg_releases values(%{$apackages-{$package}});
+my @pkg_releases = sort sort_pkg_releases values(%{$apackages-{$package}{$arch}});
 
 # All print information of package must be buffered, as the decision
 # whether to suppress all printing for the package can be executed only at
@@ -340,16 +358,17 @@
 my $max_package_len = 0;
 my $max_version_len = 0;
 my $max_name_len = 0;
+my $ipkg = $ipackages-{$package}{$arch};
 
 # print more information if required
 if ($opts{'allversions'}) {
-if ($ipackages-{$package}-{$PACKAGE}) {
-push @print_info, $ipackages-{$package}-{$PACKAGE} ;
-unless ($ipackages-{$package}-{$STATUS} =~ /not-installed/ ||
-$ipackages-{$package}-{$STATUS} =~ /config-files/) {
-push @print_info, $ipackages-{$package}-{$VERS} ;
+if ($ipkg-{$PACKAGE}) {
+push @print_info, $ipkg-{$PACKAGE}:$ipkg-{$ARCH} ;
+unless ($ipkg-{$STATUS} =~ /not-installed/ ||
+$ipkg-{$STATUS} =~ /config-files/) {
+push @print_info, $ipkg-{$VERS} ;
 }
-push @print_info, $ipackages-{$package}-{$STATUS}\n;
+push @print_info, $ipkg-{$STATUS}\n;
 } else {
 push @print_info, Not installed\n;
 }
@@ -374,11 +393,12 @@
 }
 # Then handle current release.
 (my $archive = $pkg-{$RELEASE}) =~ s/_.*//;
-push @print_info, {$PACKAGE = $pkg-{$PACKAGE},
+my $pa = $pkg-{$PACKAGE} . : 

Bug#696655: apt-show-versions lacks multiarch support

2013-01-24 Thread Greg Klanderman

And here's an additional patch on top of my previous one that updates
the comments describing the cache format.

Greg

Index: apt-show-versions
===
--- apt-show-versions	(revision 2469)
+++ apt-show-versions	(revision 2470)
@@ -205,9 +205,9 @@
 # Get hash with all installed packages from cache or create new hash
 # and write cache if root
 # $ipackages structure example:
-# {'dblatex' = {'Version' = '0.2.8-6',
-#'Status' = 'install ok installed',
-#'Package' = 'dblatex'},
+# {'dblatex' = {'amd64' = {'Version' = '0.2.8-6',
+#'Status' = 'install ok installed',
+#'Package' = 'dblatex'}},
 #  ...}
 my $ipackages;
 
@@ -222,18 +222,18 @@
 
 # Get available packages list from cache if possible
 # $apackages structure example:
-# {'dblatex' = {'ftp.de.debian.org_debian_dists_stable'
-# = {'Version' = '0.2-2',
-# 'Release' = 'ftp.de.debian.org_debian_dists_stable',
-# 'Package' = 'dblatex'},
-#'ftp.de.debian.org_debian_dists_testing'
-# = {'Version' = '0.2.8-2',
-# 'Release' = 'ftp.de.debian.org_debian_dists_testing',
-# 'Package' = 'dblatex'},
-#'ftp.de.debian.org_debian_dists_unstable'
-# = {'Version' = '0.2.8-6',
-# 'Release' = 'ftp.de.debian.org_debian_dists_unstable',
-# 'Package' = 'dblatex'}},
+# {'dblatex' = {'amd64' = {'ftp.de.debian.org_debian_dists_stable'
+# = {'Version' = '0.2-2',
+# 'Release' = 'ftp.de.debian.org_debian_dists_stable',
+# 'Package' = 'dblatex'},
+#'ftp.de.debian.org_debian_dists_testing'
+# = {'Version' = '0.2.8-2',
+# 'Release' = 'ftp.de.debian.org_debian_dists_testing',
+# 'Package' = 'dblatex'},
+#'ftp.de.debian.org_debian_dists_unstable'
+# = {'Version' = '0.2.8-6',
+# 'Release' = 'ftp.de.debian.org_debian_dists_unstable',
+# 'Package' = 'dblatex'}}},
 #  ...}
 my $apackages;
 my $cache_file_corrupt;


Bug#696655: apt-show-versions lacks multiarch support

2012-12-25 Thread Richard Scherping
Package: apt-show-versions
Version: 0.20
Severity: important

Dear Maintainer,

apt-show-versions always has been a great tool to check for old packages that
were still installed but no longer in the repos. However, since the
introduction of mulitarch, it does not recognize installed multiarch packages
correctly.
Example:

richard@huron:~$ apt-show-versions | grep ia32
ia32-libs-gtk/wheezy uptodate 1:0.1
ia32-libs-gtk-i386 1:0.1 installed: No available version in archive
ia32-libs-i386 1:0.4 installed: No available version in archive
nvidia-libopencl1-ia32/wheezy uptodate 304.48-1
richard@huron:~$ apt-cache policy ia32-libs-gtk
ia32-libs-gtk:
  Installiert:   1:0.1
  Installationskandidat: 1:0.1
  Versionstabelle:
 *** 1:0.1 0
900 http://ftp.de.debian.org/debian/ wheezy/main amd64 Packages
101 http://ftp.de.debian.org/debian/ sid/main amd64 Packages
100 /var/lib/dpkg/status
richard@huron:~$ apt-cache policy ia32-libs-gtk-i386
ia32-libs-gtk-i386:i386:
  Installiert:   1:0.1
  Installationskandidat: 1:0.1
  Versionstabelle:
 *** 1:0.1 0
900 http://ftp.de.debian.org/debian/ wheezy/main i386 Packages
101 http://ftp.de.debian.org/debian/ sid/main i386 Packages
100 /var/lib/dpkg/status
richard@huron:~$

This should be fixed IMHO...

Richard



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (900, 'testing'), (101, 'unstable'), (30, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt-show-versions depends on:
ii  apt  0.9.7.7
ii  libapt-pkg-perl  0.1.26+b1
ii  perl [libstorable-perl]  5.14.2-16

apt-show-versions recommends no packages.

apt-show-versions suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org