Sometimes upstream uses version strings so awkward, the ebuild have to use formulas like: MY_PV=$(replace_version_separator 1 '_' $(replace_version_separator 2 '-' $(replace_version_separator 3 '_'))) MY_P=${PN}_linux_source_${MY_PV} This is a case when I would prefer doing something like that: MY_P=$(format_version_string '${PN}_linux_source_$1_$2-$3_$4') where $1, $2, $3 and $4 would be respective version components. The implementation of such a function could be as simple as: format_version_string() { local fstr=$1 set -- $(get_version_components) eval echo "${fstr}" }
i tweaked the func to pass extra arguments to get_version_components http://sources.gentoo.org/eclass/versionator.eclass?r1=1.15&r2=1.16