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 }
in all the ebuilds ive written/modified ive seen this needed like twice ... i.e. it isnt a useful idea