Package: aptitude
Version: 0.6.11-1
Control: found -1 0.6.8.2-1

Hi,

I actually ran into the following on Debian Wheezy, but then also was
able to reproduce this in Sid:

If I try to download and view the changelog of a package from an
official "Debian Backports" repository
(e.g. 
http://metadata.ftp-master.debian.org/changelogs/main/r/redmine/wheezy-backports_changelog,
the repository's release identification is
"release v=,o=Debian Backports,a=wheezy-backports,n=wheezy-backports,l=Debian 
Backports,c=main")
in the NCurses TUI by pressing "Shift-C", aptitude currently claims, it's
not an official package: "You can only view changelogs of official
Debian packages."

And yes, there is a related fix in Sid (https://bugs.debian.org/714619),
but only in one place out of two as it seems: only for the command line
interface.  And indeed, if I do the same from the command line on Sid,
it works as expected, at least in Sid: "aptitude changelog
redmine=2.5.1-2\~bpo70+2" works fine.

There seems to be some kind of code duplication. The according code
locations are:

~/aptitude/aptitude → git grep -3n in_debian
src/cmdline/cmdline_changelog.cc-333-           {
src/cmdline/cmdline_changelog.cc-334-             // Move this to a central 
location and just display an
src/cmdline/cmdline_changelog.cc-335-             // apt error?
src/cmdline/cmdline_changelog.cc:336:             bool in_debian=false;
src/cmdline/cmdline_changelog.cc-337-
src/cmdline/cmdline_changelog.cc-338-             for(pkgCache::VerFileIterator 
vf=ver.FileList();
src/cmdline/cmdline_changelog.cc:339:                 !vf.end() && !in_debian; 
++vf)
src/cmdline/cmdline_changelog.cc-340-               if(!vf.File().end() && 
vf.File().Origin()!=NULL &&
src/cmdline/cmdline_changelog.cc-341-                  
(strcmp(vf.File().Origin(), "Debian")==0 ||
src/cmdline/cmdline_changelog.cc-342-                   
strcmp(vf.File().Origin(), "Debian Backports")==0))
src/cmdline/cmdline_changelog.cc:343:                 in_debian=true;
src/cmdline/cmdline_changelog.cc-344-
src/cmdline/cmdline_changelog.cc:345:             if(!in_debian)
src/cmdline/cmdline_changelog.cc-346-               {
src/cmdline/cmdline_changelog.cc-347-                 _error->Error(_("%s is 
not an official Debian package, cannot display its changelog."), input.c_str());
src/cmdline/cmdline_changelog.cc-348-                 continue;
--
src/view_changelog.cc-385-
src/view_changelog.cc-386-void view_changelog(pkgCache::VerIterator ver)
src/view_changelog.cc-387-{
src/view_changelog.cc:388:  bool in_debian=false;
src/view_changelog.cc-389-
src/view_changelog.cc-390-  string pkgname = ver.ParentPkg().Name();
src/view_changelog.cc-391-
--
src/view_changelog.cc-405-
src/view_changelog.cc-406-  // TODO: add a configurable association between 
origins and changelog URLs.
src/view_changelog.cc-407-  for(pkgCache::VerFileIterator vf=ver.FileList();
src/view_changelog.cc:408:      !vf.end() && !in_debian; ++vf)
src/view_changelog.cc-409-    if(!vf.File().end() && vf.File().Origin()!=NULL &&
src/view_changelog.cc-410-       strcmp(vf.File().Origin(), "Debian")==0)
src/view_changelog.cc:411:      in_debian=true;
src/view_changelog.cc-412-
src/view_changelog.cc:413:  if(!in_debian)
src/view_changelog.cc-414-    {
src/view_changelog.cc-415-      show_message(_("You can only view changelogs of 
official Debian packages."),
src/view_changelog.cc-416-             NULL, cw::get_style("Error"));

src/cmdline/cmdline_changelog.cc:341 ff. is already fixed,
src/view_changelog.cc:410 ff. is not.

BTW, you can't blame Manuel or Rhonda for not fixing both places.  Code
duplication is evil and leads to such issues. I'm glad that Rhonda
noticed the general issue (#714619) and even wrote a patch, and that
Manuel applied it.

I suspect Rhonda grepped for the error message (as I did in the first
place, too) and since the two error messages differ a lot, we both only
found one place initially.

-- Package-specific info:
Terminal: eterm-color
$DISPLAY is set.
which aptitude: /usr/bin/aptitude

aptitude version information:
aptitude 0.6.11 compiled at Jun  2 2014 09:03:58
Compiler: g++ 4.8.3
Compiled against:
  apt version 4.12.0
  NCurses version 5.9
  libsigc++ version: 2.2.11
  Gtk+ support disabled.
  Qt support disabled.

Current library versions:
  NCurses version: ncurses 5.9.20140712
  cwidget version: 0.5.17
  Apt version: 4.12.0

aptitude linkage:
        linux-vdso.so.1 (0x00007fff057ba000)
        libapt-pkg.so.4.12 => /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 
(0x00007fd6e384c000)
        libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5 
(0x00007fd6e3616000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 
(0x00007fd6e33eb000)
        libsigc-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libsigc-2.0.so.0 
(0x00007fd6e31e6000)
        libcwidget.so.3 => /usr/lib/x86_64-linux-gnu/libcwidget.so.3 
(0x00007fd6e2edf000)
        libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 
(0x00007fd6e2c1d000)
        libboost_iostreams.so.1.55.0 => 
/usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.55.0 (0x00007fd6e2a05000)
        libxapian.so.22 => /usr/lib/libxapian.so.22 (0x00007fd6e25fa000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007fd6e23dc000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
(0x00007fd6e20d1000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd6e1dd0000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x00007fd6e1bb9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd6e1810000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fd6e160d000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd6e1408000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd6e11f0000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 
(0x00007fd6e0fe0000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fd6e0dbc000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd6e0bb4000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fd6e09ae000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd6e41f5000)
-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (400, 'stable'), (110, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.15-trunk-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages aptitude depends on:
ii  aptitude-common           0.6.11-1
ii  libapt-pkg4.12            1.0.6
ii  libboost-iostreams1.55.0  1.55.0+dfsg-2
ii  libc6                     2.19-7
ii  libcwidget3               0.5.17-1
ii  libgcc1                   1:4.9.1-1
ii  libncursesw5              5.9+20140712-2
ii  libsigc++-2.0-0c2a        2.2.11-4
ii  libsqlite3-0              3.8.5-2
ii  libstdc++6                4.9.1-1
ii  libtinfo5                 5.9+20140712-2
ii  libxapian22               1.2.18-1

Versions of packages aptitude recommends:
ii  aptitude-doc-cs [aptitude-doc]  0.6.11-1
ii  aptitude-doc-en [aptitude-doc]  0.6.11-1
ii  aptitude-doc-es [aptitude-doc]  0.6.11-1
ii  aptitude-doc-fi [aptitude-doc]  0.6.11-1
ii  aptitude-doc-fr [aptitude-doc]  0.6.11-1
ii  aptitude-doc-it [aptitude-doc]  0.6.11-1
ii  aptitude-doc-ja [aptitude-doc]  0.6.11-1
ii  aptitude-doc-ru [aptitude-doc]  0.6.11-1
ii  libparse-debianchangelog-perl   1.2.0-1
ii  sensible-utils                  0.0.9

Versions of packages aptitude suggests:
pn  apt-xapian-index  <none>
pn  debtags           <none>
pn  tasksel           <none>

-- no debconf information

Reply via email to