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

Bug 8442

Summary: consed would be cool
Product: Portage Development Reporter: SpanKY <vapier>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: carpaski, mholzer, radek
Priority: High    
Version: 2.0   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description SpanKY gentoo-dev 2002-09-26 21:44:40 UTC
a kind of conditional sed would be nice to have ...

every once in a while ill have an ebuild that i want to use sed in to fix some 
makefile or config file ...
there are aspects i want to change everytime, other aspects i want to change 
only sometimes ...

EXAMPLE:
cvsup has hardcoded paths to /usr/local and has optional support for X and 
opengl gui frontends

CURRENT CODE:
seduse() { [ -z "`use ${1}`" ] && echo "${2}" || echo ":" }
src_compile() {
sed -e "s:/usr/local:${EZM3_INSTALL}:" \
    -e "s:touch:ranlib:" \
    -e "s:`seduse X 'import_X11():dont_import_X11()'`:" \
    -e "s:`seduse opengl 'import_OpenGL():dont_import_OpenGL()'`:" \
                COMMON.old > COMMON
}

FUTURE CODE:
src_compile() {
consed -e "s:/usr/local:${EZM3_INSTALL}:" \
       -e "s:touch:ranlib:" \
       X?      ( -e "s:import_X11():dont_import_X11():" ) \
       opengl? ( -e "s:import_OpenGL():dont_import_OpenGL():" ) \
                COMMON.old > COMMON
}
Comment 1 SpanKY gentoo-dev 2004-03-05 06:28:18 UTC
in all the ebuilds ive written/modified ive seen this needed like twice ... i.e. it isnt a useful idea