On Tue, Jun 02, 2009 at 08:58:55PM +0200, Tomas Pospisek wrote:
> good idea!

thanks.  it was the obvious solution when you think about it though.

> let's consider what would happen if dlocate would work with compressed  
> text files instead:

yeah, i thought about that on Saturday.  Preliminary tests showed that
it was about 10 times slower than grepping uncompressed text...and
since dlocate's reason for existence is speed, i decided not to use
compression.


on my main system (a combined workstation/server/dev box/everything box)
with 7501 packages installed, /var/lib/dlocate/dlocatedb.txt is 54MB in
size. gzip compresses that to around 4.6MB.

for me, the instant response of dlocate (~0.04 seconds avg search time)
is very much worth the extra disk space used. going back to ~0.4 seconds
(first uncached search) or ~0.25 seconds (subsequent searches), there
is a noticable delay between hitting enter on the dlocate command and
getting the reponse back.

maybe i should make compression an option (using config file
/etc/default/dlocate).

it wouldn't be hard to do something like:

GREP="grep"
. /etc/default/dlocate
[ "$COMPRESS_DLOCATE" = "1" ] && GREP="zgrep"

and then replace every instance of grep with $GREP

i've got dlocate-1.02 almost ready to go, with a minor man page bug fix
and a new feature (list kernel packages). i'll add optional support for
compression (turned of by default) before releasing it.

  * fixed example in dlocate.1 man page again (Closes: #466662)
  * added '-k', and '-K' commands to list kernels and related packages



BTW, the new '-k' option is a replacement for another little script i've
been using for years called 'dpkg-list-kernels'

ganesh:/usr/local/src/debian/dlocate/dlocate-1.02# ./dlocate -k
nvidia-kernel-source
linux-image-2.6.28.7
virtualbox-ose-modules-2.6.28.7
linux-image-2.6.29.2
linux-image-2.6.29.1
virtualbox-ose-modules-2.6.29.2
virtualbox-ose-modules-2.6.29.1
nvidia-kernel-common
nvidia-kernel-2.6.28.7
nvidia-kernel-2.6.29.2
nvidia-kernel-2.6.29.1

one really good use for it is to remove old kernels and related modules:

dlocate -k | egrep '2.6.28|2.6.29.1' | xargs apt-get purge


and '-K' is similar to what i used to run as 'dpkg-list-kernels | xargs dpkg -l'

ganesh:/usr/local/src/debian/dlocate/dlocate-1.02# ./dlocate -K
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
+++-=====================================-=====================================-=============================================
ii  linux-image-2.6.28.7                  ganesh.2.6.28.7                       
Linux kernel binary image for version 2.6.28
ii  linux-image-2.6.29.1                  ganesh.2.6.29.1                       
Linux kernel binary image for version 2.6.29
ii  linux-image-2.6.29.2                  ganesh.2.6.29.2                       
Linux kernel binary image for version 2.6.29
ii  nvidia-kernel-2.6.28.7                180.29-1+ganesh.2.6.28.7              
NVIDIA binary kernel module for Linux 2.6.28
ii  nvidia-kernel-2.6.29.1                180.44-2+ganesh.2.6.29.1              
NVIDIA binary kernel module for Linux 2.6.29
ii  nvidia-kernel-2.6.29.2                180.44-2+ganesh.2.6.29.2              
NVIDIA binary kernel module for Linux 2.6.29
ii  nvidia-kernel-common                  20080825+1                            
NVIDIA binary kernel module common files
ii  nvidia-kernel-source                  180.44-2                              
NVIDIA binary kernel module source
ii  virtualbox-ose-modules-2.6.28.7       2.1.4-dfsg-1+ganesh.2.6.28.7          
VirtualBox modules for Linux (kernel 2.6.28.
ii  virtualbox-ose-modules-2.6.29.1       2.2.0-dfsg-1+ganesh.2.6.29.1          
VirtualBox modules for Linux (kernel 2.6.29.
ii  virtualbox-ose-modules-2.6.29.2       2.2.2-dfsg-2+ganesh.2.6.29.2          
VirtualBox modules for Linux (kernel 2.6.29.



craig

-- 
craig sanders <c...@taz.net.au>

One man's theology is another man's belly laugh.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to