Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 161254 - gentoolkit equery list misses installed g-cpan packages
Summary: gentoolkit equery list misses installed g-cpan packages
Status: RESOLVED CANTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on: 163990
Blocks:
  Show dependency tree
 
Reported: 2007-01-10 01:49 UTC by Paul B. Henson
Modified: 2007-03-17 02:57 UTC (History)
3 users (show)

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


Attachments
list_all_packages.py (list_all_ebuilds.py,748 bytes, text/plain)
2007-01-10 19:22 UTC, Paul Varner (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul B. Henson 2007-01-10 01:49:52 UTC
I recently installed a handful of packages generated by g-cpan into a local overlay. "equery l" does not list any of them, although emerge seems to know they are installed. Here is an example:

The ebuild:
-----
# ls -l /usr/portage-local/perl-gcpan/AFS
total 12
-rw-r--r-- 1 root root  562 Jan  9 15:25 AFS-2.4.0.ebuild
-rw-r--r-- 1 root root  847 Jan  9 15:25 Manifest
drwxr-xr-x 2 root root 4096 Jan  9 15:25 files
-----

emerge shows it as installed:
----
# emerge -pv perl-gcpan/AFS

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] perl-gcpan/AFS-2.4.0  0 kB [1]

Total size of downloads: 0 kB
Portage overlays:
 [1] /usr/portage-local
----

equery l doesn't find it:
----
# equery l | grep AFS
----

even searching for all packages including overlays:
----
# equery l -o perl-gcpan/AFS
[ Searching for package 'AFS' in 'perl-gcpan' among: ]
 * installed packages
 * overlay tree (/usr/portage-local /usr/portage-legacy)
----

interestingly, equery f finds it:
----
# equery f perl-gcpan/AFS
[ Searching for packages matching perl-gcpan/AFS... ]
* Contents of perl-gcpan/AFS-2.4.0:
/usr
/usr/lib64
/usr/lib64/perl5
/usr/lib64/perl5/5.8.8
/usr/lib64/perl5/5.8.8/x86_64-linux
/usr/lib64/perl5/vendor_perl
[...]
----

The exact same behavior is exhibited for the other packages I installed via g-cpan generated ebuilds.


Reproducible: Always

Steps to Reproduce:
1. generate ebuild with g-cpan
2. emerge it
3. run equery l

Actual Results:  
see description

Expected Results:  
I would have expected equery l to correctly list the installed package.

Portage 2.1.1-r1 (default-linux/amd64/2006.0, gcc-3.4.6, glibc-2.4-r3,
2.6.16-gentoo-r13 x86_64)
=================================================================
System uname: 2.6.16-gentoo-r13 x86_64 Dual Core AMD Opteron(tm) Processor
280
Gentoo Base System version 1.12.5
Last Sync: Mon, 04 Dec 2006 23:20:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: [Not Present]
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
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-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild
/etc/terminfo"
CXXFLAGS="-march=k8 -O2 -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg distlocks metadata-transfer nodoc notitles
sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://mirrors.csumb.edu/gentoo/
http://distro.ibiblio.org/pub/linux/distributions/gentoo/
http://mirror.usu.edu/mirrors/gentoo/
http://prometheus.cs.wmich.edu/gentoo"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times
--compress --force --whole-file --delete --delete-after --stats
--timeout=180 --exclude='/distfiles' --exclude='/local'
--exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage-local /usr/portage-legacy"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="amd64 X acl alsa berkdb bitmap-fonts cli cracklib crypt cups dlloader
dri eds elibc_glibc emboss encode foomaticdb fortran gif gnome gstreamer
gtk2 iconv imlib input_devices_evdev input_devices_keyboard
input_devices_mouse isdnlog jpeg kde kerberos kernel_linux lzw lzw-tiff mp3
mpeg ncurses nls nptl nptlonly opengl pam pcre perl png pppd python qt3 qt4
quicktime readline reflection sdl session spell spl ssl tiff truetype-fonts
type1-fonts usb userland_GNU video_cards_apm video_cards_ark
video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix
video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128
video_cards_i810 video_cards_mga video_cards_neomagic video_cards_nv
video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage
video_cards_siliconmotion video_cards_sis video_cards_sisusb
video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng
video_cards_v4l video_cards_vesa video_cards_vga video_cards_via
video_cards_vmware video_cards_voodoo xorg xpm xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS,
LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Paul Varner (RETIRED) gentoo-dev 2007-01-10 02:28:44 UTC
I'm not sure what to tell you at this point since it works for me.

# equery list -o AFS
[ Searching for package 'AFS' in all categories among: ]
 * installed packages
 * overlay tree (/usr/local/portage /usr/portage/local/layman/webapps-experimental /usr/portage/local/layman/sunrise)
[--O] [ ~] perl-gcpan/AFS-2.4.0 (0)

# equery l -o perl-gcpan/AFS
[ Searching for package 'AFS' in 'perl-gcpan' among: ]
 * installed packages
 * overlay tree (/usr/local/portage /usr/portage/local/layman/webapps-experimental /usr/portage/local/layman/sunrise)
[--O] [ ~] perl-gcpan/AFS-2.4.0 (0)

Are you running equery as root, regular user, or sudo? What version of gentoolkit do you have installed?
Comment 2 Paul B. Henson 2007-01-10 03:01:00 UTC
Arg! The infamous "it works for me" :)... Meaning I'm probably either doing something stupid or have some peculiarity in my config <sigh>...

I'm running it as root, version 0.2.2. I have other ebuilds in my local overlay that are listed fine. 

It looks like equery finds installed packages by reading from /var/db/pkg?

Interestingly, 

# strace equery l -o perl-gcpan/AFS 2>&1 | grep 'open("/var/db/pkg/'| grep
DIRECTORY
open("/var/db/pkg/sys-libs", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/sys-auth", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-editors", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-portage", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/dev-util", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/net-libs", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/sys-boot", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/dev-lang", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-admin", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-misc", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-forensics", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/mail-mta", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/sys-process", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/net-mail", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/net-firewall", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/dev-perl", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-vim", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-arch", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/sys-fs", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/net-nds", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/dev-libs", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-shells", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/app-crypt", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/sys-apps", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/net-fs", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/sys-devel", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/perl-core", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/dev-python", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/dev-db", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/virtual", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/net-misc", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/net-analyzer", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
open("/var/db/pkg/sys-kernel", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4

it doesn't seem to read the perl-gcpan directory, even though it's there:

# ls -l /var/db/pkg
total 136
drwxr-xr-x  6 root root 4096 Jan  9 16:47 app-admin
drwxr-xr-x  7 root root 4096 Jan  9 16:46 app-arch
drwxr-xr-x  7 root root 4096 Jan  8 14:05 app-crypt
drwxr-xr-x  5 root root 4096 Jan  8 14:04 app-editors
drwxr-xr-x  3 root root 4096 Jan  8 14:05 app-forensics
drwxr-xr-x  4 root root 4096 Aug  3 18:32 app-misc
drwxr-xr-x  3 root root 4096 Oct  2 17:54 app-portage
drwxr-xr-x  3 root root 4096 Oct  2 16:53 app-shells
drwxr-xr-x  3 root root 4096 Jan  8 14:04 app-vim
drwxr-xr-x  5 root root 4096 Jan  9 16:47 dev-db
drwxr-xr-x  4 root root 4096 Oct  2 17:01 dev-lang
drwxr-xr-x 13 root root 4096 Jan  9 16:45 dev-libs
drwxr-xr-x 24 root root 4096 Jan  9 16:47 dev-perl
drwxr-xr-x  4 root root 4096 Aug  3 18:32 dev-python
drwxr-xr-x  6 root root 4096 Jan  8 14:04 dev-util
drwxr-xr-x  3 root root 4096 Oct  2 17:14 mail-mta
drwxr-xr-x  3 root root 4096 Jan  8 14:05 net-analyzer
drwxr-xr-x  3 root root 4096 Jan  8 14:04 net-firewall
drwxr-xr-x  4 root root 4096 Jan  8 14:04 net-fs
drwxr-xr-x  3 root root 4096 Jan  8 14:04 net-libs
drwxr-xr-x  3 root root 4096 Apr 28  2006 net-mail
drwxr-xr-x  8 root root 4096 Jan  8 14:04 net-misc
drwxr-xr-x  3 root root 4096 Jan  8 14:04 net-nds
drwxr-xr-x  7 root root 4096 Jan  9 16:47 perl-core
drwxr-xr-x  6 root root 4096 Jan  9 16:47 perl-gcpan
drwxr-xr-x 35 root root 4096 Jan  9 16:47 sys-apps
drwxr-xr-x  4 root root 4096 Jan  8 14:05 sys-auth
drwxr-xr-x  3 root root 4096 Oct  2 17:14 sys-boot
drwxr-xr-x 25 root root 4096 Oct  2 17:15 sys-devel
drwxr-xr-x  6 root root 4096 Oct  2 17:09 sys-fs
drwxr-xr-x  4 root root 4096 Jan  8 14:04 sys-kernel
drwxr-xr-x 14 root root 4096 Jan  9 16:46 sys-libs
drwxr-xr-x  7 root root 4096 Jan  8 14:05 sys-process
drwxr-xr-x 10 root root 4096 Jan  9 16:47 virtual

Is there something wrong with the ebuild in my overlay?

# ls -lR /usr/portage-local/perl-gcpan/AFS
/usr/portage-local/perl-gcpan/AFS:
total 12
-rw-r--r-- 1 root root  562 Jan  9 15:25 AFS-2.4.0.ebuild
-rw-r--r-- 1 root root  847 Jan  9 15:25 Manifest
drwxr-xr-x 2 root root 4096 Jan  9 15:25 files

/usr/portage-local/perl-gcpan/AFS/files:
total 4
-rw-r--r-- 1 root root 229 Jan  9 15:25 digest-AFS-2.4.0


emerge, as mentioned, does list it as installed, and does seem to access that dir:

# strace emerge -pv perl-gcpan/AFS 2>&1 | grep /var/db/pkg | grep gcpan
stat("/var/db/pkg/perl-gcpan/AFS-2.4.0", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
stat("/var/db/pkg/perl-gcpan/AFS-2.4.0", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
access("/var/db/pkg/perl-gcpan/AFS-2.4.0/IUSE", R_OK) = 0
open("/var/db/pkg/perl-gcpan/AFS-2.4.0/IUSE", O_RDONLY) = 3
access("/var/db/pkg/perl-gcpan/AFS-2.4.0/USE", R_OK) = 0
open("/var/db/pkg/perl-gcpan/AFS-2.4.0/USE", O_RDONLY) = 3


Any suggestions?

Thanks...
Comment 3 Paul Varner (RETIRED) gentoo-dev 2007-01-10 04:57:11 UTC
All equery is doing is calling portage to get the list of packages. The only other thing of note is that my test box is running unstable, where you are running stable. I won't be able to test on a stable system until sometime tomorrow. In the meantime if you do 'env ACCEPT_KEYWORDS="~amd64" equery list -o AFS' does it make a difference?
Comment 4 Paul Varner (RETIRED) gentoo-dev 2007-01-10 19:22:16 UTC
Created attachment 106396 [details]
list_all_packages.py

I can't reproduce this on a stable system either.  What does equery which AFS return? Secondly, does the attached small python program return the g-cpan ebuilds in the list of ebuilds?
Comment 5 Paul B. Henson 2007-01-11 00:02:26 UTC
'env ACCEPT_KEYWORDS="~amd64" equery list -o AFS' does not find the package, nor does it appear to open the g-cpan directory in my overlay according to strace.

-----
# equery which AFS
!!! No masked or unmasked packages found for AFS
-----

The attached python script does not list any of the g-cpan packages in my overlay, nor does strace show it opening the g-cpan directory in my overlay, although it appears to open and look in all of the other directories in my overlay.

I do have portage mounted ro over NFS from a central server, I didn't think that made a difference and didn't see any warnings in the wiki entry (http://gentoo-wiki.com/HOWTO_Using_a_shared_portage_via_NFS) about any special configuration to account for it. So far, everything else has worked as expected.

Sorry for the hassle :(. There must be something different between your system and my configuration. I'm not sure why only these perl-gcpan packages are the ones acting up. The only thing I notice different about them is that there is no perl-gcpan category in /usr/portage, only in my overlay. All of the other packages in my overlay that are acting correctly are in existing categories. But given that everything works fine on your system that's presumably not the underlying problem...
Comment 6 Paul Varner (RETIRED) gentoo-dev 2007-01-11 01:38:07 UTC
dev-portage: Do you have any input on this? The attached script is the slimmed down version of the portage calls that the 'equery list' command is running. It appears that the dbapi.cp_all() call is not seeing the perl-gcpan packages. 

The 'equery which' command that is also failing is calling vartree.dbapi.match() and porttree.dbapi.xmatch() which is also failing to see the perl-gcpan packages.
Comment 7 Aaron Brooks 2007-02-07 05:20:20 UTC
(In reply to comment #5)
...
> Sorry for the hassle :(. There must be something different between your system
> and my configuration. I'm not sure why only these perl-gcpan packages are the
> ones acting up. The only thing I notice different about them is that there is
> no perl-gcpan category in /usr/portage, only in my overlay. All of the other
> packages in my overlay that are acting correctly are in existing categories.
> But given that everything works fine on your system that's presumably not the
> underlying problem...

perl-gcpan /should/ be added to /usr/portage/profiles/categories. Adding this fixes equery/emerge -s/eix searches. Unless I'm missing something, the lack of perl-gcpan in categories appears to be an oversight. Frankly, I'd rather see an "exclusions" file to exclude the much rarer non-category directories in portage directory or overlays. At any rate, I believe perl-gcpan should be added to categories.

Comment 8 Paul B. Henson 2007-02-13 02:14:07 UTC
I can confirm that adding perl-gcpan to /usr/portage/profiles/categories does fix the problem on my system. This will presumably get overwritten the next time I sync though. Any chance on getting it added to the authoritative copy soon?

I am curious though why it appeared to work correctly for Paul Varner, who presumably had a stock categories file without the entry?
Comment 9 Paul Varner (RETIRED) gentoo-dev 2007-02-13 05:33:04 UTC
I just figured out why it worked for me. I have a /etc/portage/categories file which contains the perl-gcpan category that was apparently added by g-cpan.  Which version of g-cpan do you have installed?
Comment 10 Paul B. Henson 2007-02-13 19:07:15 UTC
Ah, on my build host, where I installed g-cpan and generated the binary packages, I do indeed have an /etc/portage/categories. However, there seemed no intuitive reason or requirement to install g-cpan on the clients where the binary packages are actually installed. As such, there is no /etc/portage/categories on them. Is there any documentation I might have missed indicating that g-cpan must be installed on any system on which a g-cpan generated ebuild is installed? As I said, that seems rather nonintuitive and theoretically undesirable.

For now, I suppose a workaround is to manually create /etc/portage/categories on the clients with the necessary entry. What would be the best long-term solution? Aaron's suggestion of having a list of things to exclude rather than a list of things to include? Adding an einfo to the g-cpan ebuild indicating that a manual update of /etc/portage/categories is required if g-cpan generated ebuilds will be installed on other systems?
Comment 11 Paul Varner (RETIRED) gentoo-dev 2007-02-13 19:26:12 UTC
Okay, we now know why it is broken. You were using a build host and distributing the ebuilds and I was not.  The solution to the issue is to create the /etc/portage/categories file on the client systems.

I'm cc'ing perl for their input, but the only long term fix that I can think of is to document in g-cpan that you need the /etc/portage/categories file for portage and other portage related tools to work correctly. 



Comment 12 Paul Varner (RETIRED) gentoo-dev 2007-02-15 04:27:21 UTC
Your issue is actually caused by bug #163990
Comment 13 Paul Varner (RETIRED) gentoo-dev 2007-03-17 02:57:25 UTC
Since equery relies on portage to get the packages, I can't fix anything in equery in regards to this bug. The underlying portage bug that allowed packages to be installed without an entry in a categories file has been fixed.