Re: Suggestion to change text on faq page on searching for packages
On 4/03/2016 7:09 PM, matthias.hinkfoth@gmx.de wrote:
> On Thu, Mar 03, 2016 at 09:19:38PM -0800, Ian Kelling wrote:
>> http://backports.debian.org/FAQ/
>> The first suggested command for searching,
>> dpkg -l |awk '/^ii/ && $3 ~ /bpo[6-8]/ {print $2}'
>> found 1/10 packages I had installed. The 2nd one found them all.
>> I suggest removing the first one. At the very least, make it
>> be the second suggestion instead of the first.
>
> ... ideally fix the command:
> $ dpkg -l
> is the same as
> $ dpkg-query -l
>
> both commands face the problem, that the version column has a fixed
> width, which is obviously too short.
>
> my suggestion:
> $ dpkg-query -W | awk '$2 ~ /bpo[6-8]/ {print $1}'
There is some other weirdness going on here.
If I run "dpkg-query -l" as is.... the version is, indeed truncated, but
if I do "dpkg-query -l|grep screen" for instance, I get the full version
-- same command, but the second with grep.
If I do "dpkg-query -l|grep [.]*", then I see the full version (no
truncation).
There is an environment variable called COLUMNS and that may be
adjusted, but the terminal (putty in my case) will cause it to adjust.
If I set my width to 400 in putty, then "dpkg-query -l" shows the full
version.
If I set COLUMNS in the environment to 800, it reverts back to 400 at
some point ... I can immediately echo the variable and see it as 800,
then I run "dpkg-query -l" again and the value returned to 400.
So, some weirdness to do with what has to be displayed and what the
terminal considers to be your /real/ (or imagined) terminal width.
Interesting.
Cheers
AndrewM
Reply to: