Problem happened during install (~x86 stage2), when doing "emerge --emptytree system" and emerge reached and updated the portage package (say # 30 of 92 packages), portage had to restart itself and restarts merging the system from beginning (back to # 1 of 92). I guess this has something to do with the --emptytree option. Reproducible: Always Steps to Reproduce: 1. emerge --emptytree system (during install) 2. 3. Actual Results: Emerge restarted and will be caught in and endless loop because it keeps updating the portage package and restarting from the beginning. Expected Results: Continued with the following packages. Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 2.6.11-gentoo-r3 i686) ================================================================= System uname: 2.6.11-gentoo-r3 i686 AMD Athlon(tm) XP 1600+ Gentoo Base System version 1.4.16 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] dev-lang/python: 2.3.4-r1, 2.4.1-r1 sys-apps/sandbox: 1.2.11 sys-devel/autoconf: [Not Present] sys-devel/automake: [Not Present] sys-devel/binutils: 2.16.1 sys-devel/libtool: [Not Present] virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -momit-leaf-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -momit-leaf-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distcc distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://adelie.polymtl.ca/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.ccccom.com http://mirror.datapipe.net/gentoo http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://ftp.easynet.nl/mirror/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/ ftp://mirror.scarlet-internet.nl/pub/gentoo" MAKEOPTS="-j7" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowex 3dnowext X aac alsa aotuv apm avi berkdb bitmap-fonts bzip2 cddb cdparanoia cpudetection crypt cups custom-cflags dga divx4linux dvd dvdread encode ffmpeg font-server fortran gdbm gif gimpprint gstreamer gtk gtk2 imagemagick imlib jpeg jpeg2k kde kdeenablefinal kdexdeltas libclamav lzo mad mmap mmx mmxext mng mozilla mp3 mpeg ncurses nls nonfsv4 nptl nptlonly oav ogg oggvorbis opengl pam pdflib perl pic png ppds python qt quicktime readline real rtc samba sdl sndfile spell sse ssl svg tcpd tga tiff truetype truetype-fonts unicode userlocales vcd vorbis win32codecs winbind wmf xml2 xmms xprint xv xvid xvmc zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
for a temporary fix I assume that after portage compiles you should be able to cancel the emerge then use --resume and or --skipfirst a few times to get past the loop.
Followup: I restarted the install but did "emerge portage" before the "emerge --emptytree system" and the problem didn't occur anymore.
Did portage loop more than once? Portage is designed to restart if it upgrades itself, and this may happen once during an emerge -e system. However, if Portage never changes version then it is never restarted.
(In reply to comment #3) > Did portage loop more than once? > > Portage is designed to restart if it upgrades itself, and this may happen once > during an emerge -e system. However, if Portage never changes version then it > is never restarted. Indeed it should not loop indefinitely because portage would be upgraded the second time round, I was wrong making that statement. I can't confirm it though since I killed the compilation when it restarted. Since nobody else seems to have this problem I assume it was something weird I did the first time round, and not that the solution was emerging portage *before* the emerge -e system the second time to circumvent the supposed bug.
Resolving then, I checked out the code that manages this and it appears to be saneas long as portage.VERSION is set properly.