Improve snapshot version schema

Use 1.6.999 as base version, with GIT details after.
This commit is contained in:
Markus Frosch 2019-05-02 16:35:37 +02:00
parent 2044422c91
commit 8b3b5ffce0
1 changed files with 8 additions and 0 deletions

View File

@ -54,10 +54,18 @@ if [ -z "$UPSTREAM_GIT_NOREPO" ]; then
echo "Missing '${PROJECT}.git' directory!" >&2
exit 1
fi
else
cd "${PROJECT}.git"
fi
git_version=$(git describe --tags "${UPSTREAM_GIT_BRANCH}")
package_version=$(echo "$git_version" | sed -e 's/^v//' -e 's/-/./g')
# increase version for snapshots
major_version="$(echo "$package_version" | cut -d. -f1-2)"
git_suffix="$(echo "$package_version" | cut -d. -f4-)"
package_version="${major_version}.999.${git_suffix}"
tarball="${workdir}/${PROJECT}-${package_version}.tar"
git archive --format=tar --prefix="${PROJECT}-${package_version}/" -o "${tarball}" "${UPSTREAM_GIT_BRANCH}"