Your message dated Sat, 29 Dec 2012 13:47:27 +0000
with message-id <[email protected]>
and subject line Bug#564293: fixed in dlocate 1.02+nmu3
has caused the Debian Bug report #564293,
regarding dlocate: '-lsbin' option always returns error code of '1'
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.)


-- 
564293: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=564293
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dlocate
Version: 1.02
Severity: normal


Example:

    % dlocate -lsbin bash > /dev/null ; echo $?
    1

More general:

    # count how many times a '1' error code happens with 100 packages   
    % for f in `dglob | head -n 100` ; do dlocate -lsbin $f > /dev/null ; echo 
$? ; done | sort | uniq -c
        100 1

First I'd thought the trouble might be error codes
from a 'grep' or 'sed' filter:

    % grep -nA 11 "'\-lsbin')" `which dlocate` | tail -n 12
    386:            '-lsbin')
    387-                if [ -s $DPKG_INFO/$PKG.list ] ; then
    388-                    dlocate -L $PKG | \
    389-                    xargs -r ls -lLd 2> /dev/null | \
    390-                    grep -v "^[^-]" | \
    391-                    grep -E '^-.{2,8}[xs]' | \
    392-                    sed -e 's/.* \//\//' | \
    393-                    xargs -r ls -1
    394-                else
    395-                    echo Package $PKG not installed or $PKG.list is 
empty. >&2
    396-                fi
    397-                ;;

But that can't be so, as the code from lines #388-393 returns
the expected error code:

    PKG=dash
    dlocate -L $PKG | xargs -r ls -lLd 2> /dev/null | grep -v "^[^-]" | grep -E 
'^-.{2,8}[xs]' | sed -e 's/.* \//\//' | xargs -r ls -1 ; echo $?
    /bin/dash
    0

...and yet that code also fails to return an error code for bogus
packages:

    PKG=dish
    dlocate -L $PKG | xargs -r ls -lLd 2> /dev/null | grep -v "^[^-]" | grep -E 
'^-.{2,8}[xs]' | sed -e 's/.* \//\//' | xargs -r ls -1 ; echo $?
    Package dish not installed or dish.list is empty.
    0

The problem seems to be that the above quoted '-lsbin'
routine doesn't set the '$result' variable (line #415 is the last line
of code in 'dlocate'):

    grep -n result `which dlocate`
    282:    result=$?
    288:    result=$?
    295:    result=$?
    303:    result=$?
    310:    result=$?
    415:test -n "$result" && exit $result

So: line #415 sees no "$result"  and returns a '1', and the '-lsbin'
routine always returns a '0'. Other surrounding routines seem to have
this problem as well.

Attached is a patch for the '-lsbin' routine only.


HTH...

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

Kernel: Linux 2.6.31-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.14       Command-line tools to process Debi
ii  dpkg                          1.15.3.1   Debian package management system
ii  perl                          5.10.1-8   Larry Wall's Practical Extraction 

dlocate recommends no packages.

dlocate suggests no packages.

-- no debconf information
--- /usr/bin/dlocate    2009-06-02 21:29:06.000000000 -0400
+++ /tmp/dlocate        2010-01-08 19:05:41.000000000 -0500
@@ -391,8 +391,10 @@
                     grep -E '^-.{2,8}[xs]' | \
                     sed -e 's/.* \//\//' | \
                     xargs -r ls -1
+                    result=$?
                 else
                     echo Package $PKG not installed or $PKG.list is empty. >&2
+                    result=1
                 fi
                 ;;
 

--- End Message ---
--- Begin Message ---
Source: dlocate
Source-Version: 1.02+nmu3

We believe that the bug you reported is fixed in the latest version of
dlocate, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
John Paul Adrian Glaubitz <[email protected]> (supplier of updated 
dlocate package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 29 Dec 2012 14:32:54 +0100
Source: dlocate
Binary: dlocate
Architecture: source all
Version: 1.02+nmu3
Distribution: unstable
Urgency: low
Maintainer: Craig Sanders <[email protected]>
Changed-By: John Paul Adrian Glaubitz <[email protected]>
Description: 
 dlocate    - fast alternative to dpkg -L and dpkg -S
Closes: 563881 564293
Changes: 
 dlocate (1.02+nmu3) unstable; urgency=low
 .
   * Non-maintainer upload.
   * Fix handling of multiple arguments for several commands (Closes: #563881).
   * Fix dlocate return codes for several commands on exit (Closes: #564293).
Checksums-Sha1: 
 902148c7ea339f8be41a26b48e6925f1634e5e60 1391 dlocate_1.02+nmu3.dsc
 dd02a0e21ebe80ad39276b138bc61b748907f3f3 38114 dlocate_1.02+nmu3.tar.gz
 a29ca629184db74686351caf4d20e24ae193dbad 22674 dlocate_1.02+nmu3_all.deb
Checksums-Sha256: 
 e341a2178ea3cb40eed9a955bc2f05febf26f70aa2d9bc37847b1e38fcd9eeb1 1391 
dlocate_1.02+nmu3.dsc
 1b3b7921442a78d99226989b6ed4bc7606c719bb366178442c1dca19e00d4e89 38114 
dlocate_1.02+nmu3.tar.gz
 da68d2d7434d40bc27ea9bf83bd065281f23d6acdde8d82cb6b9dd2dcb73dea9 22674 
dlocate_1.02+nmu3_all.deb
Files: 
 22eb5cdb854502e041aa5ed7b19b4d86 1391 utils optional dlocate_1.02+nmu3.dsc
 66ce966787fec94510a1db8135d13046 38114 utils optional dlocate_1.02+nmu3.tar.gz
 5eb0a6bb859d4c9970259099d7ff0f43 22674 utils optional dlocate_1.02+nmu3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJQ3vLeAAoJEHQmOzf1tfkTkpoQAMLEykuDwv85xQP8EnpdPLsI
S7ADgBvGaA/KKcsWsIivX8ai3DduV45hDFw5s1ojXTgo0hhIIjT/B4UsYQ8ntOcC
lppCmpK0kCGxWOWJh3iKl4L5QBgrzwZbHtu6mM2itNQl4peK9sMfmFufKzkkihJg
FyltlY1k/+Lj5ysIlgGGgJsMA9owh9K40xrlG6OiZ06CRrR6xIesfNnjWDahbKZi
IHATj3xuv+HBScDc3tO1t6VqTNzejQnslpuuez9K87AT01H3j830n8MHeIZoU7VZ
uwbVmbCwfw7KhWCjXIOI8xggffcDGz17CDrHMTXs74/UECmvLbnmFObG/8iavqwz
0fT9qWFrdSRBwY/4GBZPaMF6Sjna6OzI0pN//cTiqAf4rGG7SurpF+MvrngemHe3
JLafCfWiW8tWzkm24jciRIKZ+3Zoob5NgpQ4MiFxqwJES6YCItM3ndm64hfjGb7P
Jmn3dary4MDyajiF26vrKMuVceaRb9jNugAeBDbpcjtSaFH+LA0Hy72FN9/X+v3q
1Ge6Z1gBDtpQvRjN4j6hFqdQYaDMDCy/hQB/tokwKl91n5/4c8jC2p/eYt9LROJa
DSXlYMt/qdDvyGVRuzzTBMeRfs3/OCZjWSgT5kJ68CTCPXNIvwoWSlnmBIkiUfdO
Tg7sPlUqH3FQFQVBhKp/
=dKjD
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to