Commit fd219894 authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Merge branch feature/ramana.prakhya/version with refs/heads/master into...

Merge branch feature/ramana.prakhya/version with refs/heads/master into refs/merge-requests/460/train
parents e1b22cba 70412cd8
Pipeline #64078 passed with stages
in 19 minutes and 6 seconds
......@@ -5,7 +5,8 @@ if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
set(OpenVDSVersion 2.1.999)
file(READ "${CMAKE_SOURCE_DIR}/VERSION" OpenVDSVersion)
string(STRIP ${OpenVDSVersion} OpenVDSVersion)
project(OpenVDS VERSION ${OpenVDSVersion})
......
2.1.999
......@@ -78,7 +78,7 @@ esac
done
if [[ "$openvds_version" == "" ]]; then
openvds_version=$(grep -E "set\(OpenVDSVersion" "$openvds_path/CMakeLists.txt" | sed 's/[^0-9|.]*//g')
openvds_version=${openvds_version:-$(<$openvds_path/VERSION)}
fi
if [[ "$openvds_version" == "" ]]; then
echo "Please specify OpenVDS version using -v --version"
......
......@@ -10,14 +10,13 @@ if sys.version_info[0] < 3:
openvds_version=""
dir_path = os.path.dirname(os.path.realpath(__file__))
with open(dir_path + "/CMakeLists.txt", "r") as file:
with open(dir_path + "/VERSION", "r") as file:
for line in file:
if re.search("set\(OpenVDSVersion", line):
openvds_version = re.sub("[^0-9|.]*", "", line)
openvds_version = line.strip()
break
if not openvds_version:
print("Fatal error: Failed to parse version from CMakeLists.txt")
print("Fatal error: Failed to parse version from VERSION")
exit(1)
try:
......
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