[Aptitude-devel] Bug#755677: aptitude: Recognizes "Debian Backports" packages as official for downloading changelogs on the CLI, but not in the TUI

Axel Beckert abe at debian.org
Tue Jul 22 11:21:26 BST 2014

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


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-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: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-386-void view_changelog(pkgCache::VerIterator ver)
src/view_changelog.cc:388:  bool in_debian=false;
src/view_changelog.cc-390-  string pkgname = ver.ParentPkg().Name();
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: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:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://lists.alioth.debian.org/pipermail/aptitude-devel/attachments/20140722/a294d1a7/attachment.ksh>
-------------- next part --------------

-- 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

More information about the Aptitude-devel mailing list