Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34967 - ebuild foo.ebuild config fails when foo installed from tbz2 package
Summary: ebuild foo.ebuild config fails when foo installed from tbz2 package
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2003-12-03 06:04 UTC by Jon Scott
Modified: 2004-10-22 08:48 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Scott 2003-12-03 06:04:24 UTC
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"
Comment 1 Masatomo Nakano (RETIRED) gentoo-dev 2004-01-01 03:19:39 UTC
Fixed in cvs
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2004-02-08 17:55:18 UTC
supposed to be fixed in 2.0.50 which is stable now. If this bug is not fixed please reopen.
Comment 3 Jon Scott 2004-03-22 04:00:49 UTC
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
Comment 4 Masatomo Nakano (RETIRED) gentoo-dev 2004-04-09 07:53:23 UTC
Fixed again
Comment 5 Nicholas Jones (RETIRED) gentoo-dev 2004-10-22 08:48:07 UTC
Bug has been fixed and released in stable portages on or before 2.0.51-r2