Your message dated Wed, 10 Jun 2009 09:48:40 +1000
with message-id <[email protected]>
and subject line Re: Bug#487471: dlocate -l
has caused the Debian Bug report #487471,
regarding emulate dpkg -l better for no args or arg=.
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
487471: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487471
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dlocate
Version: 0.94
Severity: wishlist
Gentlemen, if
-l Simplistic emulation of `dpkg -l'. Shows all packages which
match package.
Then allow us to compare
$ dlocate -l #Gives nothing: please fix to be like
$ dpkg -l
OK, then how about
$ dlocate .
which one would think would perhaps be like
$ dpkg -l \*
Well, in fact what
$ dlocate .
does actually do, I never found out, as I had already hit ^C when the
CPU meter blew its top and the grinding sound started on my disks.
--- End Message ---
--- Begin Message ---
severity 487471 wishlist
tags 487471 + unreproducible wontfix
stop
On Wed, Jun 10, 2009 at 05:34:21AM +0800, [email protected] wrote:
> These days plain dlocate -l
> just prints a usage message.
(wontfix - works as designed)
yes, it's supposed to. the search pattern argument is required in
dlocate -l. if you don't provide it, you get the usage message.
yes, 'dpkg -l' behaves differently. 'dlocate -l' is a regexp-enhanced
emulation of 'dpkg -l', not an exact clone. i want it to print a help
message in this case.
anyway, it's hard to see any point in making dlocate behave the same as
dpkg in this particular instance: 'dpkg -l' with no other arguments is
about twice as fast as 'dlocate -l .' because it's not doing a regexp
search and because it doesn't have to make two passes through the data.
> also dlocate -l impress
> cant find openoffice.org-impress though
> it is in apt-cache search, but it can find other uninstalled packages.
(unreproducible - dlocate can find openoffice.org-impress)
(wontfix - digression about COLUMNS var)
huh? it can find it exactly the same as dpkg -l can. in both searches
below, openoffice.org-impress is the second package listed (standard 80
column terminal output).
indra:~$ dlocate -l impress
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-==============================================
un impressive <none> (no description available)
pn openoffice.org <none> (no description available)
un openoffice.org <none> (no description available)
indra:~$ dpkg -l '*impress*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
un impressive <none> (no description available)
pn openoffice.org <none> (no description available)
un openoffice.org <none> (no description available)
try it with a wider terminal and it'll be more obvious. e.g. 132 column
output rather than 80:
indra:~$ dlocate -l impress
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===========================-===========================-========================================================================
un impressive <none> (no description
available)
pn openoffice.org-impress <none> (no description
available)
un openoffice.org2-impress <none> (no description
available)
indra:~$ dpkg -l '*impress*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===========================-===========================-======================================================================
un impressive <none> (no description
available)
pn openoffice.org-impress <none> (no description
available)
un openoffice.org2-impress <none> (no description
available)
if you need to post-process the output in a script then use something like:
apt-cache search impress | awk '{print $1}"
or
COLUMNS=132 dlocate -l impress | tail -n +6 | awk '{print $2}'
or
COLUMNS=132 dpkg -l '*impress*' | tail -n +6 | awk '{print $2}'
(you need the 'tail -n +6' to skip the first 5 header lines for both
dpkg and dlocate)
hmmm. further testing shows that you don't need to set the COLUMNS
variable for dpkg when the output is being piped....it can tell whether
output is being redirected or not. I'm not entirely sure that that's a
good idea. it makes sense if stdout is redirected to a pipe, but not if
stdout is redirected to a file (because it prevents you from being able
to log exactly what you see when it's run without redirection).
I'll do some more research/thinking on this and decide whether i have to
either:
1. do nothing. you can already use the COLUMNS env var to influence
dlocate's output. This is most likely, i don't see much need to
duplicate existing functionality, especially when it's a standard part
of the unix shell environment.
or
2. add a '-c'/'--columns' or '--wide' or similar option to dlocate.
possible, but won't happen until i completely rewrite dlocate's option
handling.
or
3. figure out how to tell whether stdout is being redirected from within
a bash script - if output is redirected then COLUMNS should default to
132 or 256 or something rather than 80.
i don't like this last option much at all - it takes away control from
the user, and makes assumptions about what they want which may not be
true.
craig
--
craig sanders <[email protected]>
--- End Message ---