Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 327679 - versionator.eclass: new function: version_format_string()
Summary: versionator.eclass: new function: version_format_string()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-10 11:03 UTC by Michał Górny
Modified: 2010-07-18 21:25 UTC (History)
0 users

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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-07-10 11:03:26 UTC
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}"
}
Comment 1 SpanKY gentoo-dev 2010-07-18 21:25:01 UTC
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