Package: dlocate
Version: 0.94
Severity: normal

    % man dlocate | grep -n -C 2 "dlocate -l '^.. libc5'"
    51-              Extended regular expression are allowed. For example,
    52-
    53:              dlocate -l '^.. libc5'
    54-
    55-              will list all the package names starting with `libc5'.

A test of the above:

    # dump example to /tmp/foo
    % F=/tmp/foo
    % dlocate -l '^.. libc5' > $F
    
    # lines and size?
    % wc -cl $F 
        32169 2190365 /tmp/foo

    # what's in there?
    % head /tmp/foo
    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
    
+++-=================-=================-====================================================
    pn  3270-common       <none>            (no description available)
    pn  3c5x9utils        <none>            (no description available)
    pn  3dchess           <none>            (no description available)
    ii  3ddesktop         0.2.9-6           "Three-dimensional" desktop switcher
    pn  3dwm-clock        <none>            (no description available)
    
Compare to:

    % dpkg -l libc5
    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  libc5             5.4.46-15         The Linux C library version 5 
(run-time libraries)

'htop' (while "dlocate -l '^.. libc5'" is running) shows:

    egrep -- ^..|libc5 /var/lib/dlocate/dpkg-list

That is, the " " (space) got replaced by a "|", ('egrep' logical
'OR').  So 'egrep' dumps the whole of 'dpkg-list', then 'dlocate'
reformats it.

The " " is replaced with a "|" here:

    % grep -n -m 1 'PKGS_REGEXP=' /usr/bin/dlocate
    148:PKGS_REGEXP=$(echo "$PKGS" | sed -e 's/ /|/g')


A look at the code shows the '-l' switch parser is part of a complex
'for' loop. The '-l' switch should eat the next argument, but that
won't work in a 'for' loop.  Some ad hoc variable action follows, (e.g.
line #148).  

Is there some reason not to use 'getopts', or even 'set' & 'shift'?
(If I understood the switch parsing code better, I'd attach a patch.)

Hope this helps...


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages dlocate depends on:
ii  dctrl-tools [grep-dctrl]      2.12       Command-line tools to process Debi
ii  dpkg                          1.14.16.6  package maintenance system for Deb
ii  findutils                     4.2.33-1   utilities for finding files--find,
ii  locate                        4.2.33-1   maintain and query an index of a d
ii  perl                          5.8.8-12   Larry Wall's Practical Extraction 

dlocate recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to