Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 438292 - app-portage/gentoolkit-0.3.0.6-r3 - equery b mishandles directory search
Summary: app-portage/gentoolkit-0.3.0.6-r3 - equery b mishandles directory search
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-14 07:06 UTC by Sergey S. Starikoff
Modified: 2012-10-18 11:41 UTC (History)
0 users

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 Sergey S. Starikoff 2012-10-14 07:06:00 UTC
Default query (symbolic link in path) result:
$ equery b /lib/udev/rules.d/
 * Searching for /lib/udev/rules.d/ ... 
media-libs/libmtp-1.1.4 (/lib/udev/rules.d)
media-sound/alsa-utils-1.0.25-r1 (/lib/udev/rules.d)
net-print/hplip-3.12.9-r1 (/lib/udev/rules.d)
sys-apps/pcsc-lite-1.8.2 (/lib/udev/rules.d)
sys-apps/usb_modeswitch-1.2.3_p20120531-r1 (/lib/udev/rules.d)
sys-auth/consolekit-0.4.5_p20120320-r1 (/lib/udev/rules.d)
sys-fs/lvm2-2.02.88 (/lib/udev/rules.d)
sys-fs/udev-171-r6 (/lib/udev/rules.d)
sys-fs/udisks-1.0.4-r2 (/lib/udev/rules.d)
sys-power/upower-0.9.16 (/lib/udev/rules.d)

But direct path (only directories, no symbolic links) search result is empty:
$ equery b /lib64/udev/rules.d/
 * Searching for /lib64/udev/rules.d/ ... 
$
(nothing was find)

$ file /lib
/lib: symbolic link to `lib64'

Additional info:
$ emerge --info
Portage 2.1.11.9 (default/linux/amd64/10.0, gcc-4.5.4, glibc-2.15-r2, 3.4.9-gentoo x86_64)
=================================================================
System uname: Linux-3.4.9-gentoo-x86_64-Intel-R-_Core-TM-_i5_CPU_661_@_3.33GHz-with-gentoo-2.1
Timestamp of tree: Fri, 12 Oct 2012 15:15:01 +0000
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories:

gentoo
    location: /usr/portage
    sync: rsync://mirror.yandex.ru/gentoo-portage/
    priority: -1000

rion
    location: /var/lib/layman/rion
    masters: gentoo
    priority: 0

zugaina
    location: /var/lib/layman/zugaina
    masters: gentoo
    priority: 1

local
    location: /usr/local/portage
    masters: gentoo
    priority: 2

ABI="amd64"
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA GPL* skype-eula"
ACCEPT_PROPERTIES="*"
ALSA_CARDS="hda-intel"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol"
ANT_HOME="/usr/share/ant"
APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
ARCH="amd64"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode multilib"
CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump"
CAMERAS="ptp2"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules/* *.py[co]"
COLORTERM="Terminal"
CONFIG_PROTECT="/etc /etc/conf.d/clock /etc/rc.conf /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-2JnVKKgkqC,guid=daf6e1d48e1a93c1e5bebf5e507a5646"
DEFAULT_ABI="amd64"
DESKTOP_SESSION="xfce"
DISPLAY=":0.0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/usr/bin/vim"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--ask=y --verbose --autounmask=n"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec sftp -P \${port} \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""
FFLAGS="-O2 -pipe"
FOO2ZJS_DEVICES="hp1018"
GCC_SPECS=""
GDK_USE_XFT="1"
GENTOO_MIRRORS="ftp://mirror.yandex.ru/gentoo-distfiles/ 		http://mirror.yandex.ru/gentoo-distfiles/ 		http://ftp.corbina.net/pub/Linux/gentoo 		ftp://ftp.corbina.net/pub/Linux/gentoo/                 http://ftp.chg.ru/pub/Linux/distributions/gentoo/                 ftp://ftp.chg.ru/pub/Linux/distributions/gentoo/ 		distfiles.gentoo.org"
GLADE_CATALOG_PATH=":"
GLADE_MODULE_PATH=":"
GLADE_PIXMAP_PATH=":"
GPG_AGENT_INFO="/tmp/gpg-dGE1Qr/S.gpg-agent:3597:1"
GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx"
GRUB_PLATFORMS=""
GSETTINGS_BACKEND="gconf"
HG="/usr/bin/hg"
HOME="/home/ftn"
INFOPATH="/usr/share/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.22/info"
INPUT_DEVICES="keyboard mouse"
IUSE_IMPLICIT="prefix"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KERNEL="linux"
LANG="ru_RU.UTF8"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LC_NUMERIC="POSIX"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LDFLAGS_amd64="-m elf_x86_64"
LDFLAGS_x32="-m elf32_x86_64"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe %s"
LIBDIR_amd64="lib64"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_n32="lib32"
LIBDIR_n64="lib64"
LIBDIR_o32="lib"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_s390="lib32"
LIBDIR_s390x="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x32="libx32"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
LINGUAS="ru"
...
Because of post size limitations particularly skipped.
Comment 1 Paul Varner (RETIRED) gentoo-dev 2012-10-17 22:18:27 UTC
This is by design since equery using what is recorded by portage for the file name.  

Since the ebuild is installing the files as /lib/<something>, that is what portage has recorded as the name of the file and is what equery is looking at for file names that belong to a package.

I understand your concern and the use case for this to work differently.

I will need to think about how to make equery work the way you would like that doesn't cause a significant performance hit.
Comment 2 Zac Medico gentoo-dev 2012-10-18 02:56:50 UTC
This kind of query is supported by `portageq owners`. It works by using stat to get the (device, inode) pair for each of the relevant parent directories, and compares those instead of doing path comparisons (since path comparison doesn't work in this case).
Comment 3 Sergey S. Starikoff 2012-10-18 06:10:42 UTC
(In reply to comment #2)
> This kind of query is supported by `portageq owners`.
Thank you.

But 
portageq owners / /lib64/udev/rules.d/
lists the packages, owns directory; not files in a directory belonging to each package (that sometimes is useful).


(In reply to comment #1)
> I understand your concern and the use case for this to work differently.
> 
> I will need to think about how to make equery work the way you would like
> that doesn't cause a significant performance hit.

I'm not yes possess reasonable point of view about correct behaviour of equery.

This bug first of all is about that equery should not perform queries, with predetermined incorrectness of results, but echo some warning/error message instead of it.
Comment 4 Zac Medico gentoo-dev 2012-10-18 06:24:26 UTC
(In reply to comment #3)
> portageq owners / /lib64/udev/rules.d/
> lists the packages, owns directory; not files in a directory belonging to
> each package (that sometimes is useful).

Maybe this is what you want:

  portageq owners / /lib64/udev/rules.d/*
Comment 5 Sergey S. Starikoff 2012-10-18 11:41:27 UTC
(In reply to comment #4)
> Maybe this is what you want:
> 
>   portageq owners / /lib64/udev/rules.d/*

Thank you!
It looks very pretty.

But this bug is mostly about incorrect output of equery utility.
Which should either perform correct search in both cases, or echo some error message in the case, where it doesn't perform correct query.