[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#861742: apt-cache showsrc reports errors for additional successful source package results



On Wed, May 03, 2017 at 01:49:57PM +0200, Michael wrote:
> Package: apt
> Version: 1.4.1
> 
> apt-cache showsrc reports errors for every additional successful source
> package result.
> 
> For example:
> # LANG=C apt-cache showsrc xmms2-plugin-id3v2 xmms2-plugin-mad
> xmms2-plugin-vorbis > /dev/null
> W: Unable to locate package xmms2-plugin-mad
> W: Unable to locate package xmms2-plugin-vorbis
> 
> The source package for both xmms2-plugin-mad and xmms2-plugin-vorbis are
> indeed found, but it has found while searching for xmms2-plugin-id3v2.
> 
> The source package for all three xmms2-packages is the same: xmms2. For
> xmms2-plugin-id3v2 it finds "xmms2"
> as source and for rxmms2-plugin-mad it finds "xmms2" - which is already a
> valid result in
> the "seen" hash list. Therefore the resulting "xmms2" for xmms2-plugin-mad
> and xmms2-plugin-vorbis
> gets ignored, which results in an "unable to locate... " error message even
> it's indeed already
> "located".
> 
> A possible fix would be:
> 
> ###############
> --- apt-1.4.1/apt-private/private-show.cc       2017-04-24
> 18:47:55.000000000 +0200
> +++ apt-1.4.1+nmu1/apt-private/private-show.cc  2017-05-03
> 12:05:10.120323617 +0200
> @@ -336,12 +336,12 @@ bool ShowSrcPackage(CommandLine &CmdL)
>          if (_config->FindB("APT::Cache::Only-Source", false) == true)
>             if (Parse->Package() != *I)
>                continue;
> +         found = true;
> +         found_this = true;
>           std::string sha1str = Sha1FromString(Parse->AsStr());
>           if (std::find(seen.begin(), seen.end(), sha1str) == seen.end())
>           {
>              std::cout << Parse->AsStr() << std::endl;;
> -            found = true;
> -            found_this = true;
>              seen.insert(sha1str);
>           }
>        }
> ###############
> 
> ... unaudited. Please review this patch; maybe only one of those result
> lines has to be moved!

Not looked at the patch, but:

> 
> And please - fix the coding style. Not only within private-show.cc but also
> with other apt source files.
> It's heavily mixed with tabs and spaces and quite ugly with tabstop!=8.
> Please, use either tabs _or_ spaces, but not both.

The coding style is 3 spaces indentation, with 1 tab standing in for 8
spaces. That's not going to change. It makes no sense, really, but we're
not going to reformat the entire project.

(Occassionally, there are some mixups in the number of spaces, that might
get corrected when the code in question is changed.)

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev
                  |  Ubuntu Core Developer |
When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to ('inline').  Thank you.


Reply to: