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

Re: Getting a list of installed packages

Robert Guthrie <rguthrie@pobox.com> wrote:
>On Wednesday 15 November 2000 21:16, John Carline wrote:
>> Ahh! I see. You're probably right, but that's caused by the dpkg
>> command isn't it - not the pipe?  Didn't 'dpkg - l'  by itself
>> produce what was wanted?
>> If the full version is what's needed, it's listed in
>> /var/lib/dpkg/status. The dpkg command cuts it off at 14 characters
>> so the real question may be "is there a way to make dpkg  produce the
>> entire version field?"
>> I don't think so, but I could easily be wrong.
>In another branch of this thread, Colin Watson pointed out that dpkg
>seems to know if its output is going to screen (like a wide xterm) or
>to a pipe, and if it is going through a pipe, it defaults to an
>arbitrary width (which makes sense, the pipe is as "wide" as it needs
>to be).  

Well, actually, from main/enquiry.c in the dpkg source:

  else if (!isatty(1))

So actually it defaults to 80 characters (useful if you happened to be
piping it through a pager, for example). 'dpkg -l' is really just for
pretty(ish) formatted output for humans.

>He also pointed out grep-dpkg and friends, which are what I intend to use.
                          ^^^^ dctrl



Colin Watson                                     [cjw44@flatline.org.uk]

Reply to: