Better versioning for OBS

This commit is contained in:
Gioacchino Mazzurco 2019-02-08 15:18:14 -03:00
parent 6e1e3f3832
commit 5009a4e243
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#!/bin/bash
SOURCE_VERSION_FILE="$( dirname "${BASH_SOURCE[0]}" )/../../Source_Version"
VERSION_MAJOR="$(cat "${SOURCE_VERSION_FILE}" | awk -F. '{print $1}')"
VERSION_MAJOR="${VERSION_MAJOR:1}"
VERSION_MINOR="$(cat "${SOURCE_VERSION_FILE}" | awk -F. '{print $2}')"
VERSION_MINI="$(cat "${SOURCE_VERSION_FILE}" | awk -F. '{print $3}' | awk -F- '{print $1}')"
VERSION_EXTRA="$(cat "${SOURCE_VERSION_FILE}" | awk -F- '{print "-"$2"-"$3"-OBS"}')"
echo RS_MAJOR_VERSION=${VERSION_MAJOR} RS_MINOR_VERSION=${VERSION_MINOR} RS_MINI_VERSION=${VERSION_MINI} RS_EXTRA_VERSION=\"${VERSION_EXTRA}\"