* Checking //var/lib/portage for bad/illegal files: ln: `//var/lib/portage/world': File exists # ls -l /var/cache/edb/world /var/lib/portage/world ls: /var/cache/edb/world: No such file or directory -rw-r--r-- 1 root portage 5690 Oct 22 00:28 /var/lib/portage/world i guess the backward compat symlink creation is done too early. as soon i noticed this error, i suspended emerge, and i have two portages installed: # epm -q portage portage-2.0.51 portage-2.0.50-r11 Reproducible: Didn't try Steps to Reproduce: and emerge info, when these two portages installed: # emerge info Portage 2.0.51 (default-linux/x86/2004.2, gcc-3.3.4, glibc-2.3.3.20040420-r2, 2.4.22-1.2115.nptlsmp i686) ================================================================= System uname: 2.4.22-1.2115.nptlsmp i686 Intel(R) Xeon(TM) CPU 2.80GHz Gentoo Base System version 1.4.16 distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 Headers: sys-kernel/linux-headers-2.4.19-r1,sys-kernel/linux-headers-2.4.21-r1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-Os -mcpu=pentium2 -march=pentium2 -pipe -fomit-frame-pointer -ffast-math" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-Os -mcpu=pentium2 -march=pentium2 -pipe -fomit-frame-pointer -ffast-math" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs buildpkg ccache distcc noinfo sandbox sfperms userpriv usersandbox" GENTOO_MIRRORS="ftp://ftp.linux.ee/pub/gentoo/distfiles http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://gentoo.linux.no/ ftp://gentoo.linux.no/pub/gentoo/ http://ftp.easynet.nl/mirror/gentoo/" MAKEOPTS="-j25" PKGDIR="/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/gentoo/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X aalib alsa apache2 apm arts artswrappersuid avi bitmap-fonts chroot crypt cups dga directfb divx4linux dvd encodefam flac foomaticdb ggi gif gphoto2 gpm gstreamer gtk2 imagemagick imlib jpeg kde libg++ libwww lirc mad maildir memlimit mmx mng motif mozilla mpeg ncurses oggvorbis opengl oss pam perl png pthreads qt quicktime samba sdl slang speex spell ssl tiff truetype wmf x86 xinerama xml xml2 xprint xv xvid zlib video_cards_rage128 linguas_et"
install -o root -g portage -m 2770 -d "${ROOT}/var/lib/portage" einfo "Checking ${ROOT}/var/lib/portage for bad/illegal files:" find "${ROOT}/var/lib/portage" ! -group portage -o -perm -002 -print0 | $$ OLDWORLD="${ROOT}/var/cache/edb/world" NEWWORLD="${ROOT}/var/lib/portage/world" if [ ! -f "${NEWWORLD}" ]; then cp "${OLDWORLD}" "${NEWWORLD}" && \ rm -f "${OLDWORLD}" && \ ln ../../lib/portage/world "${NEWWORLD}" fi This is the offending code. Basically if NEWWORLD is not a regular file then copy the OLDWORLD over the NEWWORLD ( Creating NEWWORLD if necessary ) and remove the OLDWORLD. Then hard link something to the new world. The odd case is that on your box ../../lib/portage/world and NEWWORLD are the same, resulting in the ebuild hardlinking a file to itself, which is illegal. The question is why.
Modified the code for new portage release... Hardlink, if possible. Copy if that fails.