When I run emerge --metadata I get the following error (it also happens with emerge --sync): jurgis ~ # emerge --metadata skipping sync >>> Updating Portage cache: 75%Traceback (most recent call last): File "/usr/bin/emerge", line 2824, in ? cache.util.mirror_cache(source, cm, pdb.auxdb[porttree_root], eclass_cache=ec, verbose_instance=noise_maker) File "/usr/lib/portage/pym/cache/util.py", line 61, in mirror_cache try: trg_cache[x] = entry File "/usr/lib/portage/pym/cache/template.py", line 62, in __setitem__ self._setitem(cpv, d) File "/usr/lib/portage/pym/cache/flat_hash.py", line 85, in _setitem myf.writelines("%s=%s\n" % (k, v)) UnboundLocalError: local variable 'myf' referenced before assignment jurgis ~ # emerge --info Portage 2.1_pre5-r1 (default-linux/alpha/2006.0, gcc-3.4.4, glibc-2.3.5-r3, 2.6.16-rc5 alpha) ================================================================= System uname: 2.6.16-rc5 alpha EV56 Gentoo Base System version 1.12.0_pre16 distcc 2.18.3 alpha-unknown-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] dev-lang/python: 2.3.5, 2.4.2-r1 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-r1 sys-devel/binutils: 2.16.1-r1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r4 ACCEPT_KEYWORDS="alpha ~alpha" AUTOCLEAN="yes" CBUILD="alpha-unknown-linux-gnu" CFLAGS="-mieee -O2 -mcpu=ev56 -pipe" CHOST="alpha-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-mieee -O2 -mcpu=ev56 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distcc distlocks nostrip sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.cites.uiuc.edu/pub/gentoo/ http://adelie.polymtl.ca/ http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1" LINGUAS="en" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://134.153.48.2/gentoo-portage" USE="alpha X aac aim alsa apache2 arts audiofile bash-completion berkdb bitmap-fonts bzip2 cdr crypt cups eds encode esd flac foomaticdb gcj gdbm gif glut gnome gpm gstreamer gtk gtk2 icq imlib ipv6 jabber jpeg kde libg++ libwww lua mad mikmod motif mp3 mpeg msn ncurses nls nocd nptl nptlonly offensive ogg oggvorbis opengl oscar oss pam pcre pdflib perl png python qt quicktime readline sdl shorten sndfile spell ssl symlink tcpd truetype truetype-fonts type1-fonts udev vorbis xml xmms xv xvid yahoo zlib elibc_glibc kernel_linux linguas_en userland_GNU"
I upgraded to sys-apps/portage-2.1_pre5-r2 and encountered the same problem.
Before this problem occured, there was a power outage and the machine went down without a proper shutdown. After booting and fsck'ing, everything appeared to be fine. However, just now the file system journal aborted and automatically remounted the partition as read-only. After several reboots and full fscks, the journal keeps randomly aborting. I'm going to close this bug as INVALID because it may be due to the screwed up file system. I'll do a fresh install, and if the portage error comes up again, then I'll reopen the bug.