Summary: | running `ebuild` does not preserve environment across functions like `emerge` does | ||
---|---|---|---|
Product: | Portage Development | Reporter: | SpanKY <vapier> |
Component: | Core - Interface (emerge) | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dberkholz, mr_bones_, solar |
Priority: | High | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 56408 | ||
Bug Blocks: |
Description
SpanKY
![]() > # 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 |