Package: dlocate
Version: 0.96.1
Severity: minor
Tags: patch
If I say:
dlocate -S "$(locate /bogusfilename)"
the fruitless invocation of locate returns the zero-length argument
""; dlocate balks and returns a usage summary. Fair enough.
However, if I say:
dlocate -S $(locate /bogusfilename)
in this case dlocate is tricked into passing on the nonexistent
argument to GNU locate, which confusingly returns an error message
of its own. To top it off, if I try:
dlocate -S $(locate)
this gives two locate usage messages, not necessarily for the same
brand of locate!
Surely dlocate should always start by checking whether it has any
arguments, and if not, give its usage summary error? At present, it
not only allows runs with no $PKGS, it even corrects an empty
$PKGS_REGEXP to '^$' - I don't see how that could ever be useful.
This may imply I'm missing something, but never mind, here's a
one-liner patch that fixes the subject-line bug.
-- System Information:
Debian Release: 5.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i586)
Kernel: Linux 2.6.28.custom
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages dlocate depends on:
ii dctrl-tools [grep-dctrl 2.13.1 Command-line tools to process Debi
ii dpkg 1.14.25 Debian package management system
ii findutils 4.4.0-2 utilities for finding files--find,
ii gawk [awk] 1:3.1.5.dfsg-4.1 GNU awk, a pattern scanning and pr
ii locate 4.4.0-2 maintain and query an index of a d
ii mawk [awk] 1.3.3-11.1 a pattern scanning and text proces
ii perl 5.10.0-19 Larry Wall's Practical Extraction
dlocate recommends no packages.
dlocate suggests no packages.
-- no debconf information
--
JBR
Ankh kak! (Ancient Egyptian blessing)
diff -ur dlocate-0.96.1.pristine/dlocate dlocate-0.96.1/dlocate
--- dlocate-0.96.1.pristine/dlocate 2008-06-27 11:10:05.000000000 +0100
+++ dlocate-0.96.1/dlocate 2009-04-10 02:20:11.000000000 +0100
@@ -145,6 +145,9 @@
done
PKGS=$(echo "$PKGS" | sed -e "s/^$SEPARATOR//")
+
+[ "$PKGS" ] || dlocate_help
+
#echo $PKGS
PKGS_REGEXP=$(echo "$PKGS" | sed -e "s/$SEPARATOR/|/g")