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

Bug#717254: "apt-cache show <package>" shows Description-md5 field twice



On Thu, Jul 18, 2013 at 2:24 PM, Ansgar Burchardt <ansgar@debian.org> wrote:
> $ apt-cache show dpkg
> Package: at

(I was surprised for a second)


> It doesn't happen for all packages, for example for "apt" there's just one
> Description-md5 field.
>
> The field is present only once in the Packages index.

Somehow I managed to replace one assumption with another one *doh*
I blame the testcases … (okay, two, but the commit mentions the
Description-is-not-first-field one and that should be pretty safe) …

The problem is here that "apt-cache show" is displaying the stanza from
the start till the first "\nDescription" string. At that point it prints
whatever it thinks is the Description the user actually wants to see –
and now also the Description-md5: field right after it. After that it looks
for the end of the Description* field(s) and displays the rest of the stanza.

Works of course only as long as you have no field in between "Description"
and "Description-md5" – which you have if the package has e.g. a Multi-Arch
flag as this one is in-between for some reason (was that always the case?
 My brain somehow believes that it was sorted far more at the top).

Attached patch should fix that by skipping over Description fields in the
"left-over" of the buffer after the first Description field.
(lets see what I did wrong this time, I am starting to get a track record)


Best regards

David Kalnischkies

P.S.: Thanks for pinging 647590, I guess it can be forcemerged, but as a said
back then I am not sure if other commands don't do silly stuff while a Desc
is missing. They should be okay, now that the internal stuff is corrected,
but I will have to check that to be sure before actually closing this one.

Attachment: 0001-skip-all-Description-fields-in-apt-cache-not-just-fi.patch
Description: Binary data


Reply to: