portageq best_version does not appear to work properly with a <root> other than /. This behavior exists in 2.0.51.22-r2 and 2.1_pre1. agaffney@kagome ~ $ portageq best_version /mnt/old fluxbox agaffney@kagome ~ $ ls -ld /mnt/old/var/db/pkg/x11-wm/fluxbox-0.9.14-r1 drwxr-xr-x 2 root root 4096 2005-09-23 21:47 /mnt/old/var/db/pkg/x11-wm/fluxbox-0.9.14-r1 agaffney@kagome ~ $ portageq best_version / fluxbox x11-wm/fluxbox-0.9.14-r1 agaffney@kagome ~ $ ls -ld /var/db/pkg/x11-wm/fluxbox-0.9.14-r1 drwxr-xr-x 2 root root 4096 2005-12-10 13:18 /var/db/pkg/x11-wm/fluxbox-0.9.14-r1 Chroot'ing into /mnt/old and running 'portageq best_version / fluxbox' yields the installed version of fluxbox as it should.
`ROOT="/mnt/old" portageq best_version /mnt/old fluxbox` should work. Will fix portageq so that it's not needed.
Yes, that works, but here's another small issue: agaffney@kagome ~ $ ROOT=/mnt/old portageq best_version /mnt/old fluxbox agaffney@kagome ~ $ ROOT=/mnt/old portageq best_version /mnt/old/ fluxbox x11-wm/fluxbox-0.9.14-r1 The <root> parameter seems to require a trailing slash. Afaik, this is a problem with portage.db and not portageq. I know fixing portageq would be relatively easy (if not root.endswith('/'): root += '/'), but what would it take to "fix" the portage module?
Nope, that's a problem with portageq as well. Have fixed the issue.
Released in portage-2.1_pre3
Released in 2.1_pre4