i hit a snag with xorg-x11 and running `ebuild unpack` on it and i traced it back to the fact that the environment setup in previous functions (like pkg_setup()) is not passed on to subsequent functions however, if you run `emerge xorg-x11`, the environment setup in pkg_setup() *is* passed on properly to src_unpack() in this case, pkg_setup() exports a few variables that src_unpack() needs (PATCHDIR/EXCLUDED) in order to work correctly test cases that failed: # with FEATURES=noauto ebuild xorg-x11-6.7.0.ebuild setup clean unpack ebuild xorg-x11-6.7.0.ebuild clean setup unpack # with FEATURES=-noauto ebuild xorg-x11-6.7.0.ebuild unpack test case that passed: emerge xorg-x11 root@vapier 0 root # emerge info Portage 2.0.51_pre9 (2004.0, gcc-3.4.0, glibc-2.3.3_pre20040420-r0, 2.6.7-rc2) ================================================================= System uname: 2.6.7-rc2 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz Gentoo Base System version 1.4.15 distcc 2.14 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5 Binutils: sys-devel/binutils-2.15.91.0.1 ACCEPT_KEYWORDS="x86 ~x86"
> # with FEATURES=noauto > ebuild xorg-x11-6.7.0.ebuild setup clean unpack This would not work correctly because portage would clean environment before unpack. > ebuild xorg-x11-6.7.0.ebuild clean setup unpack This should work.. (I tested it in my environment and it worked)
I'm not sure if this is the same bug or just related: It appears that shell variables are preserved from pkg_setup to src_* functions, but they are not preserved as environment variables. For example: pkg_setup() { export TESTVAR=hello echo "pkg_setup" echo "---------" echo "Testing shell variable: $(echo TESTVAR=${TESTVAR})" echo "Testing environment variable: $(env | grep ^TESTVAR)" echo } src_unpack() { echo "src_unpack" echo "---------" echo "Testing shell variable: $(echo TESTVAR=${TESTVAR})" echo "Testing environment variable: $(env | grep ^TESTVAR)" echo } Results: pkg_setup --------- Testing shell variable: TESTVAR=hello Testing environment variable: TESTVAR=hello src_unpack ---------- Testing shell variable: TESTVAR=hello Testing environment variable: This is clearly not good behavior. Portage should be preserving the export attribute of variables between functions.
I'm adjusting ebuild.sh so that it correctly reuses the saved environment (and only the environment + portage exported vars after setup phase)- I'll look into this while I'm at it...
I just encountered more or less this bug with sys-apps/portage-2.0.51_pre17 + a cvs update from yesterday on the same package. The workaround for me was to call a pkg_setup from the src_unpack just so I could begin the compile process. Re comment #3 Can we expect to see your ebuild.sh update that reuses the saved environment in pre18?
Bug has been fixed and released in stable portages on or before 2.0.51-r2