When there is a 3rd level directory in /var/db/pkg when a global update is due /usr/lib/portage/pym/portage.py aborts with the python error message: Performing Global Updates: /usr/portage/profiles/updates/2Q-2004 (Could take a couple minutes if you have a lot of binary packages.) .='update pass' *='binary update' @='/var/db move' s='/var/db SLOT move' S='binary SLOT move' .............................@Traceback (most recent call last): File "/usr/bin/emerge", line 14, in ? import portage File "/usr/lib/portage/pym/portage.py", line 6343, in ? do_upgrade(mykey) File "/usr/lib/portage/pym/portage.py", line 6263, in do_upgrade db["/"]["vartree"].dbapi.move_ent(mysplit) File "/usr/lib/portage/pym/portage.py", line 4050, in move_ent fixdbentries(origcp, newcp, pkgdir) File "/usr/lib/portage/pym/portage.py", line 3409, in fixdbentries f = open(dbdir+"/"+myfile, "r") IOError: [Errno 21] Is a directory As far as I can remember this third level directory appeared after I had done something like ebuild /var/db/pkg/net-mail/uw-imap-2002e-r1/uw-imap-2002e-r1.ebuild digest after changing compile options in that ebuild to suit my needs. However, after inspected fixdbentries in portage.py there it is simply assumed that in 3408: for myfile in [f for f in os.listdir(dbdir) if not f == "CONTENTS"]: every entry returned by os.listdir(dbdir) is a file. In my case there was the directory files which caused the error. So adding an os.path.isdir() check and skipping (or deleting) the wrong entry would be a good idea IMHO. Reproducible: Always Steps to Reproduce: 1. create a 3rd-level directory in var/db/pkg like: mkdir -p /var/db/pkg/a/b/c/ 2. If there are no updates due then (maybe that's not the best way): touch /usr/portage/profiles/updates/2Q-2004 3. emerge Actual Results: See program output shown in Details. Expected Results: Perform global update.
which version of portage?
Should be most recent: 2.0.50-r6
Requires more fixing than just that particular problem. I'd rather leave it tracebacking on strange layouts than simply ignoring that something has done something wrong. *** This bug has been marked as a duplicate of 51584 ***
In my case it crushed because of qmail/files/. /var/db/pkg/mail-mta/qmail-1.03-r13: drwxr-xr-x 3 root root 624 Jun 17 14:15 ./ drwxr-xr-x 3 root root 80 Jun 11 14:21 ../ -rw-r--r-- 1 root root 9 Jun 11 14:21 CATEGORY -- snip -- drwxr-xr-x 3 root root 72 Jun 17 14:15 files/ -rw-r--r-- 1 root root 14101 Jun 11 14:21 qmail-1.03-r13.ebuild emerge should report on what is wrong and continue things instead of be crushed. Or it will make gentoo users waste a much of time. Now you know that the layout would have wrong directory, don't you? So please help users won't face the crush. I think you can make (small) test tool checks correctness of the layout.