diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/buildh.in | 2 | ||||
-rwxr-xr-x | src/build-data/scripts/dist.py | 7 | ||||
-rw-r--r-- | src/utils/version.cpp | 19 |
3 files changed, 19 insertions, 9 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in index 4e3788c65..8be48c295 100644 --- a/src/build-data/buildh.in +++ b/src/build-data/buildh.in @@ -17,6 +17,8 @@ #define BOTAN_VERSION_PATCH %{version_patch} #define BOTAN_VERSION_DATESTAMP %{version_datestamp} +#define BOTAN_VERSION_RELEASE_TYPE "%{release_type}" + #define BOTAN_VERSION_VC_REVISION "%{version_vc_rev}" #define BOTAN_DISTRIBUTION_INFO "%{distribution_info}" diff --git a/src/build-data/scripts/dist.py b/src/build-data/scripts/dist.py index bed5177c9..db6ce7800 100755 --- a/src/build-data/scripts/dist.py +++ b/src/build-data/scripts/dist.py @@ -237,9 +237,14 @@ def main(args = None): def content_rewriter(): for line in contents: if line == 'release_vc_rev = None\n': - yield 'release_vc_rev = \'mtn:%s\'\n' % (rev_id) + yield 'release_vc_rev = "mtn:%s"\n' % (rev_id) elif line == 'release_datestamp = 0\n': yield 'release_datestamp = %d\n' % (datestamp(options.mtn_db, rev_id)) + elif line == "release_type = \'unreleased\'": + if args[0] == 'snapshot': + yield 'release_type = "snapshot"' + else: + yield 'release_type = "released"' else: yield line diff --git a/src/utils/version.cpp b/src/utils/version.cpp index 49fec4392..32679cf63 100644 --- a/src/utils/version.cpp +++ b/src/utils/version.cpp @@ -1,6 +1,6 @@ /* * Version Information -* (C) 1999-2011 Jack Lloyd +* (C) 1999-2013 Jack Lloyd * * Distributed under the terms of the Botan license */ @@ -24,17 +24,20 @@ std::string version_string() #define QUOTE(name) #name #define STR(macro) QUOTE(macro) + /* + It is intentional that this string is a compile-time constant; + it makes it much easier to find in binaries. + */ + return "Botan " STR(BOTAN_VERSION_MAJOR) "." STR(BOTAN_VERSION_MINOR) "." STR(BOTAN_VERSION_PATCH) " (" - -#if (BOTAN_VERSION_DATESTAMP == 0) - "unreleased version built " __DATE__ -#else - "released " STR(BOTAN_VERSION_DATESTAMP) + BOTAN_VERSION_RELEASE_TYPE +#if (BOTAN_VERSION_DATESTAMP != 0) + ", dated " STR(BOTAN_VERSION_DATESTAMP) #endif - ", revision " BOTAN_VERSION_VC_REVISION - ", distribution " BOTAN_DISTRIBUTION_INFO ")"; + ", revision " BOTAN_VERSION_VC_REVISION + ", distribution " BOTAN_DISTRIBUTION_INFO ")"; #undef STR #undef QUOTE |