qdepend has an 8 KB limit on the *DEPEND files it can eat. But this is not enough with a few packages: % q depends -a -Q foo/bar * DEPEND depends: i'm such a fatty, could not eat_file(/var/db/pkg/dev-lang/php-5.1.4/DEPEND) depends: i'm such a fatty, could not eat_file(/var/db/pkg/x11-base/xorg-x11-7.0-r1/DEPEND) * RDEPEND depends: i'm such a fatty, could not eat_file(/var/db/pkg/dev-lang/php-5.1.4/RDEPEND) depends: i'm such a fatty, could not eat_file(/var/db/pkg/x11-base/xorg-x11-7.0-r1/RDEPEND) * PDEPEND depends: i'm such a fatty, could not eat_file(/var/db/pkg/x11-base/xorg-server-1.1.0/PDEPEND) On my system, the biggest *DEPEND files in vdb are rather around 10 KB: % find /var/db/pkg/ -type f -name "*DEPEND" -printf "%s %p\n" | sort -n | tail 1716 /var/db/pkg/media-video/mplayer-1.0.20060415/RDEPEND 1752 /var/db/pkg/x11-base/xorg-server-1.1.0/DEPEND 1896 /var/db/pkg/x11-libs/wxGTK-2.6.3.2/DEPEND 2291 /var/db/pkg/media-video/mplayer-1.0.20060415/DEPEND 2785 /var/db/pkg/gnome-base/gnome-2.14.1/RDEPEND 8186 /var/db/pkg/dev-lang/php-5.1.4/RDEPEND 8319 /var/db/pkg/dev-lang/php-5.1.4/DEPEND 10216 /var/db/pkg/x11-base/xorg-x11-7.0-r1/RDEPEND 10248 /var/db/pkg/x11-base/xorg-x11-7.0-r1/DEPEND 11436 /var/db/pkg/x11-base/xorg-server-1.1.0/PDEPEND The attached patch changes this limit to 16 KB (in functions "qdepends_vdb_deep()" and "qdepends_main_vdb()"). Btw, you may want to go with something even bigger, like 32 KB, just to be safe: this buffers are allocated 3 times at most (when using the "-a" option), so it should not have any significant performance inpact. Also, in "qdepends_main_vdb()", my patch decreases the filename buffer size ("buf") from 8KB to whatever _Q_PATH_MAX is (4KB here i think), like it was already done in "qdepends_vdb_deep()". And finally, it fixes two wrong calls to "eat_file()", which were using the filename buffer size as the max file size limit, instead of using the target buffer size (happened to work before, since both were 8 KB, but would have break with the above changes).
Created attachment 87623 [details, diff] qdepends-0.1.17-bigger-eat_file-buffers.patch
Ping. From what i see on cvsweb [1], only half this issue has been fixed in portage-utils-0.1.18: qdepends_main_vdb() is still using an 8KB buffer, and is still calling eat_file with a wrong buffer size argument. Also, i think increasing the "buf" size to "Q_PATH_MAX*2" was useless: it's a file path, and won't be usable anyway if longer than Q_PATH_MAX. As for increasing the "use" buffer size, although it can't hurt, it doesn't sound much useful neither (there is currently only ~2KB of global flags in use.desc). [1] http://www.gentoo.org/cgi-bin/viewcvs.cgi/portage-utils/qdepends.c?r1=1.36&r2=1.37&root=gentoo-projects
Thanks. Fixed in CVS revision 1.38 .18 will be short lived so this chnage should hopefully not take long to hit the tree.
Closing since this is fixed in 0.1.19.