Commit a0c425d3 authored by Vitaly Lipatov's avatar Vitaly Lipatov

git: add version_to_tag/tag_to_version for ~ and + in versions

parent 15eb98fb
......@@ -151,6 +151,20 @@ get_last_tag()
git describe --abbrev=0 --tags 2>/dev/null
}
# Convert package version to valid git tag name
# RPM allows ~ and + in versions, but git tags cannot contain ~
# (git interprets ~ as ancestor reference)
version_to_tag()
{
echo "$1" | sed -e 's|~|.tilde.|g' -e 's|+|.plus.|g'
}
# Convert git tag name back to package version
tag_to_version()
{
echo "$1" | sed -e 's|\.tilde\.|~|g' -e 's|\.plus\.|+|g'
}
# check if tag is last commit tag (put on the last commit). if tag is missed, check with the last tag in repo
is_last_commit_tag()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment