Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 9551

Summary: S vars nested in an if-else block dont get regenerated properly
Product: Portage Development Reporter: SpanKY <vapier>
Component: UnclassifiedAssignee: Daniel Robbins (RETIRED) <drobbins>
Status: RESOLVED FIXED    
Severity: minor CC: carpaski, h3y
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

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.