When a package is installed from a tbz2 with emerge -k, running ebuild config for that package fails with the error (using postgresql as the example but this applies to other ebuilds including homegrown ones): /usr/sbin/ebuild.sh: line 1197: /var/tmp/portage-pkg/postgresql-7.3.4-r1/inf/postgresql-7.3.4-r1.ebuild: No such file or directory !!! ERROR: postgresql-7.3.4-r1/postgresql-7.3.4-r1 failed. !!! Function , Line 1197, Exitcode 1 !!! error sourcing ebuild A few quick print statements in /usr/sbin/ebuild.sh reveal that the value of ${EBUILD} is correct until it sources ${T}/environment, at which point it gets set to the (non-existent) /var/tmp/portage-pkg/... grep ^EBUILD /var/tmp/portage/postgresql-7.3.4-r1/temp/environment gives: EBUILD=/var/tmp/portage-pkg/postgresql-7.3.4-r1/inf/postgresql-7.3.4-r1.ebuild But, not knowing much about Portage's internals, I haven't had chance to trace through and find out where this is getting set. Reproducible: Always Steps to Reproduce: 1. Create a tbz2 package from an ebuild 2. Install the package 3. Run ebuild /var/db/pkg/blah/foo.ebuild config Actual Results: error sourcing ebuild (see details) Expected Results: run the pkg_config() function from the ebuild Emerge info gives: Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-gentoo-r5) ================================================================= System uname: 2.4.20-gentoo-r5 i686 AMD Athlon(tm) XP 1500+ Gentoo Base System version 1.4.3.8p1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium2 -mcpu=athlon-xp -O2 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=pentium2 -mcpu=athlon-xp -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox ccache autoaddcvs buildpkg" GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 oss encode foomaticdb jpeg libg++ mad mikmod ncurses nls png sdl spell xml2 xmms zlib gdbm berkdb slang readline tetex svga java guile gpm libwww python esd imlib oggvorbis motif mozilla cdr X gtk gnome2 gnome cups mmx 3dnow apm opengl tcltk xv dgai gtk2 bonobo avi mpeg quicktime pam ssl crypt imap tcpd pdflib alsa smooth postgres truetype xft2 perl ppds -qt -kde -gif -arts"
Fixed in cvs
supposed to be fixed in 2.0.50 which is stable now. If this bug is not fixed please reopen.
The exact case above seems ok in 2.0.50-r1, however, trying to run "ebuild foo.ebuild postinst" produces the same error as in the original bug report. Interestingly running "ebuild foo.ebuild config; ebuild foo.ebuild postinst" works fine, and once that has been done, postinst works fine every time. I have made a temporary hacky fix for this prob by altering /usr/sbin/ebuild.sh from line 38 as follows: if [ -f "${T}/environment" ]; then SAVED_EBUILD="${EBUILD}" source "${T}/environment" >& /dev/null EBUILD="${SAVED_EBUILD}" unset SAVED_EBUILD # so it doesn't get saved in environment again fi
Fixed again
Bug has been fixed and released in stable portages on or before 2.0.51-r2