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

Bug#218995: Patch for #218995



On Mon, Sep 17, 2012 at 03:58:00PM +0200, David Kalnischkies wrote:
>On Mon, Sep 17, 2012 at 2:38 PM, Steve McIntyre <steve@einval.com> wrote:
>> On Sun, Sep 09, 2012 at 01:06:08PM -0400, Sam Lidder wrote:
>>>I've attached a patch which appends package version information to the
>>>package names for apt-cache depends and rdepends. The patch is also
>>>available here:
>>>
>>>https://code.launchpad.net/~sam-lidder/apt/debian-experimental
>>>(revision 2249)
>>>
>>>Notes:
>>>- version information is not displayed for virtual/non-real packages
>>>- version is always printed, even if CompareOp is 0, so as to be
>>>  consistent with output of 'Dependencies' for 'apt-cache showpkg <pkg>'
>>
>> Hi Sam,
>>
>> Awesome - I was just about to start hacking on the apt-cache code to
>> do this and found you'd beaten me to it! :-)
>
>Truth to be told: He did it even earlier as part of his GSoC proposal.

Ah, OK... :-)

>> Apt maintainers - I need this fixed to allow me to fix #687949 in
>> debian-cd, which is a serious bug affecting wheezy builds right
>> now. Could you please prepare a build for upload with this patch
>> added? If there's a worry about maybe breaking other users, maybe keep
>> existing behaviour by default and add a "-v" or "--with-versions"
>> flag to get the versions included?
>
>It is indeed a worry about breaking users. There is so much stuff outwhere
>using apt-* in strange ways that nearly every change to the output usually
>results in breaking at least one of them. I e.g. didn't know that debian-cd
>scripts are using it …

To be honest, I only worked this out while tracking down this bug -
this deep section of the code seems to have been working fine ever
since Raphael wrote it ~10 years ago! :-)

>The other thing is that the generated output is less than stellar.
>I think if we output something here it should be in the way we see
>it in the Packages file and not intermixed some internal values …
>Depends: awesome (0 (null))
>Depends: stuff (3 2-1)
>Nobody knows what 0 and 3 are and they could possibly change any
>given minute (with an ABI break of course) -- beside that this number
>printed includes also other stuff (like the OR flag) and showpkg is kind
>of a debug command, so "compatibility" with it isn't really needed.

ACK. I was a little surprised to see the output format here. I've
added support for parsing the versions in apt's internal format, by
digging through source code to find the definitions. I can always
switch that code back to parsing human-readable text, thought.

>If you need it we can add it with -o APT::Cache::ShowVersion=1 as
>Depends: awesome
>Depends: stuff (<< 2-1)
>I guess. -v is taken by --version; -V would be an option and very similar
>to apt-get -V (--verbose-versions), but i don't think this needs to consume
>a short flag which might be better used for activating a generally improved
>version of the (r)depends commands (e.g. to enable showing the dependency
>types in rdepends by default, too) with the necessary documentation …
>but that is a bit much while in freeze.
>-o flags on the other hand are cheap to add …

Sure, that all makes sense to me. I'll need to use a locally-built
apt-cache for now (as we build using squeeze), until we upgrade the
build machine after the wheezy release. I've designed around coping
with versions not being available - it will just fall back to the old
behaviour anyway. Is apt happy to ignore -o flags it doesn't
recognise, or will I have to add some detection here to cope with
older versions?

>Anyway, as this will be advertised as a debian-cd fix implemented in APT
>to the release team, feel free to define the output you need and we will
>see how to generate it. I am unable to read/write perl, so I don't know what
>is easiest. (I can see in the code though that you should have a look at
> --important, --no-recommends and similar flags to avoid doing the filtering
> in perl; but I don't get what the code does in general …).

That's fine. :-) Just adding versions in a sane manner (as you've
suggested here) is great for me. Maybe post-wheezy I'll get on to
investigating other changes for the sort_deps code, but right now is
not a good time for major surgery!

Thanks for the very quick response, it's appreciated.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"The problem with defending the purity of the English language is that
 English is about as pure as a cribhouse whore. We don't just borrow words; on
 occasion, English has pursued other languages down alleyways to beat them
 unconscious and rifle their pockets for new vocabulary."  -- James D. Nicoll


Reply to: