Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 132813 - Slocate doesn't handle Posix regexps right
Summary: Slocate doesn't handle Posix regexps right
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-09 13:04 UTC by Shein Alexey
Modified: 2006-08-01 07:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shein Alexey 2006-05-09 13:04:54 UTC
I'm trying to use regexps in slocate, but it doesn't seem to work.
For example, this one
# slocate -r '(home|etc)'
according man 7 regex should return all filename that contain 'home' OR 'etc', but slocate returns nothing, although just #slocate -r 'home' or #slocate -r 'etc' works fine.

Some info here:
avalon ~ # emerge -vpD slocate

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-apps/slocate-2.7-r8  0 kB

avalon ~ # emerge --info
Portage 2203-svn (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.6-r3, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.6.14
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/init.d /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.stream.uz/gentoo http://ftp.citkit.ru/pub/Linux/gentoo http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo"
LANG="ru_RU.koi8r"
LINGUAS="en ru"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://gentoo.stream.uz/gentoo-portage"
USE="x86 7zip X aalib alsa apache2 apm arts audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr cli crypt cups curl dri eds emboss encode ethereal exif expat fam ffmpeg foomaticdb fortran gd gdbm gif glut gmp gpm gstreamer gtk gtk2 hal idn imlib isdnlog jpeg kde lcms libg++ libwww mad mhash mikmod mng motif mp3 mpeg mysql ncurses nls ogg oggvorbis opengl oss pam pcre pdflib perl php png postgres postgresql pppd python qt quicktime readline reflection sdl session spell spl ssl tcltk tcpd tiff truetype truetype-fonts type1-fonts udev usb vorbis xine xml2 xmms xorg xv zlib linguas_en linguas_ru userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS
Comment 1 Rick Morra 2006-06-30 08:33:25 UTC
If glibc is your C library, slocate uses GNU "basic regular expressions" as described in grep(1). These expressions use extensions to the portable POSIX "basic" REs described in regex(7).

# slocate -r '\(etc\|home\)'
    will search for either 'etc' or 'home' in the database.
Comment 2 SpanKY gentoo-dev 2006-07-31 22:26:29 UTC
thanks for the explanation

resolution: this is a feature ;)
Comment 3 Shein Alexey 2006-08-01 07:13:14 UTC
(In reply to comment #1)
> If glibc is your C library, slocate uses GNU "basic regular expressions" as
> described in grep(1). These expressions use extensions to the portable POSIX
> "basic" REs described in regex(7).
> 
> # slocate -r '\(etc\|home\)'
>     will search for either 'etc' or 'home' in the database.
> 
Oops! I really missed that, thanks for the explanation. My email didn't work for about 2 months, so I've just noticed your comment :) Now going reading mans, thanks again!