From 2cf6cf19c08d6b9d3085cfe5f1a40fb25c7fa648 Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Tue, 7 Oct 2014 12:00:49 -0700 Subject: [PATCH] feat(src): add LEAN_VERSION_PATCH --- src/CMakeLists.txt | 3 ++- src/library/module.cpp | 6 +++--- src/shell/lean.cpp | 3 ++- src/version.h.in | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2efcdfa3d..afe4d3cb3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8.7) project(LEAN CXX) set(LEAN_VERSION_MAJOR 0) set(LEAN_VERSION_MINOR 2) +set(LEAN_VERSION_PATCH 0) if (NOT CMAKE_BUILD_TYPE) message(STATUS "No build type selected, default to Release") @@ -238,7 +239,7 @@ find_package(PythonInterp REQUIRED) # CPack set(CPACK_PACKAGE_NAME lean) string(TOLOWER ${CMAKE_SYSTEM_NAME} LOWER_SYSTEM_NAME) -set(CPACK_PACKAGE_FILE_NAME "lean-${LEAN_VERSION_MAJOR}.${LEAN_VERSION_MINOR}-${LOWER_SYSTEM_NAME}") +set(CPACK_PACKAGE_FILE_NAME "lean-${LEAN_VERSION_MAJOR}.${LEAN_VERSION_MINOR}.${LEAN_VERSION_PATCH}-${LOWER_SYSTEM_NAME}") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") SET(CPACK_GENERATOR TGZ) else() diff --git a/src/library/module.cpp b/src/library/module.cpp index cd019df1c..eaf0dd25a 100644 --- a/src/library/module.cpp +++ b/src/library/module.cpp @@ -135,7 +135,7 @@ void export_module(std::ostream & out, environment const & env) { serializer s2(out); std::string r = out1.str(); unsigned h = hash(r.size(), [&](unsigned i) { return r[i]; }); - s2 << g_olean_header << LEAN_VERSION_MAJOR << LEAN_VERSION_MINOR; + s2 << g_olean_header << LEAN_VERSION_MAJOR << LEAN_VERSION_MINOR << LEAN_VERSION_PATCH; s2 << h; // store imported files s2 << imports.size(); @@ -285,8 +285,8 @@ struct import_modules_fn { d1 >> header; if (header != g_olean_header) throw exception(sstream() << "file '" << fname << "' does not seem to be a valid object Lean file, invalid header"); - unsigned major, minor, claimed_hash; - d1 >> major >> minor >> claimed_hash; + unsigned major, minor, patch, claimed_hash; + d1 >> major >> minor >> patch >> claimed_hash; // Enforce version? unsigned num_imports = d1.read_unsigned(); diff --git a/src/shell/lean.cpp b/src/shell/lean.cpp index a4459d436..a983c668a 100644 --- a/src/shell/lean.cpp +++ b/src/shell/lean.cpp @@ -62,7 +62,8 @@ static void on_ctrl_c(int ) { } static void display_header(std::ostream & out) { - out << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR; + out << "Lean (version " << LEAN_VERSION_MAJOR << "." + << LEAN_VERSION_MINOR << "." << LEAN_VERSION_PATCH; if (!std::strcmp(g_githash, "GITDIR-NOTFOUND")) { out << ", commit " << std::string(g_githash).substr(0, 12); } diff --git a/src/version.h.in b/src/version.h.in index 7b8ef2dc2..13a89ae26 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -1,3 +1,4 @@ // the configured options and settings for Tutorial #define LEAN_VERSION_MAJOR @LEAN_VERSION_MAJOR@ #define LEAN_VERSION_MINOR @LEAN_VERSION_MINOR@ +#define LEAN_VERSION_PATCH @LEAN_VERSION_PATCH@