Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 9551 - S vars nested in an if-else block dont get regenerated properly
Summary: S vars nested in an if-else block dont get regenerated properly
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Daniel Robbins (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-23 08:59 UTC by SpanKY
Modified: 2011-10-30 22:20 UTC (History)
2 users (show)

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 SpanKY gentoo-dev 2002-10-23 08:59:39 UTC
so i have this code in my ebuild ...

if [ `use static` ] ; then
    SRC_URI="static target"
    S="${WORKDIR}/static"
else
    SRC_URI="dyn target"
    S="${WORKDIR}/dyn"
fi

if i run these commands, they dont work like they should ...
env USE=-static ebuild <ebuild> install
env USE=static ebuild <ebuild> install

whichever command i run first, i guess that S value gets cached and not properly
regenerated ...
if you want, i can post an example ebuild to reproduce this behavior
and i have portage 2.0.41
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2002-12-10 09:53:58 UTC
You need to put conditionals inside the SRC_URI like:

SRC_URI="static? http://static : http://dynamic"

The SRC_URI gets cached, and if you use a standard bash conditional then only
one of the conditions gets cached.