diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/buildh.in | 6 | ||||
-rw-r--r-- | src/build-data/cc/msvc.txt | 2 | ||||
-rw-r--r-- | src/cli/main.cpp | 12 | ||||
-rw-r--r-- | src/lib/cert/x509/x509_ext.h | 2 | ||||
-rw-r--r-- | src/scripts/ci/appveyor.yml | 3 | ||||
-rwxr-xr-x | src/scripts/dist.py | 67 |
6 files changed, 54 insertions, 38 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in index 6412fdcdf..d6201be19 100644 --- a/src/build-data/buildh.in +++ b/src/build-data/buildh.in @@ -226,12 +226,6 @@ Each poll generates 32 bit entropy %{target_compiler_defines} -#if defined(_MSC_VER) - // 4250: inherits via dominance (diamond inheritence issue) - // 4251: needs DLL interface (STL DLL exports) - #pragma warning(disable: 4250 4251) -#endif - /* * Compile-time deprecatation warnings */ diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt index 02e33bfab..8231c0429 100644 --- a/src/build-data/cc/msvc.txt +++ b/src/build-data/cc/msvc.txt @@ -19,7 +19,7 @@ optimization_flags "/O2" debug_info_flags "/Zi /FS" lang_flags "/EHs /GR" -warning_flags "/W3 /wd4275 /wd4267" +warning_flags "/W4 /wd4250 /wd4251 /wd4275" visibility_build_flags "/DBOTAN_DLL=__declspec(dllexport)" visibility_attribute "__declspec(dllimport)" diff --git a/src/cli/main.cpp b/src/cli/main.cpp index f6bbcc30e..f63de8fa2 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -21,11 +21,13 @@ std::string main_help() std::ostringstream oss; oss << "Usage: botan <cmd> <cmd-options>\n"; - oss << "Available commands: "; - std::copy(avail_commands.begin(), - avail_commands.end(), - std::ostream_iterator<std::string>(oss, " ")); - oss << "\n"; + oss << "Available commands:\n"; + + for(auto& cmd_name : avail_commands) + { + auto cmd = Botan_CLI::Command::get_cmd(cmd_name); + oss << cmd->cmd_spec() << "\n"; + } return oss.str(); } diff --git a/src/lib/cert/x509/x509_ext.h b/src/lib/cert/x509/x509_ext.h index caefcb855..8ea2f2da6 100644 --- a/src/lib/cert/x509/x509_ext.h +++ b/src/lib/cert/x509/x509_ext.h @@ -490,7 +490,7 @@ class BOTAN_DLL Unknown_Critical_Extension final : public Certificate_Extension std::string oid_name() const override { return "Unknown OID name"; } - bool should_encode() const { return false; } + bool should_encode() const override { return false; } std::vector<byte> encode_inner() const override; void decode_inner(const std::vector<byte>&) override; void contents_to(Data_Store&, Data_Store&) const override; diff --git a/src/scripts/ci/appveyor.yml b/src/scripts/ci/appveyor.yml index d0f59c920..58e04eea9 100644 --- a/src/scripts/ci/appveyor.yml +++ b/src/scripts/ci/appveyor.yml @@ -24,9 +24,8 @@ install: ) - cl # check compiler version -# always build via amalgamation due to build time constraints on appveyor build_script: - - python configure.py --cc=msvc --via-amalgamation --cpu=%PLATFORM% %MODE% + - python configure.py --cc=msvc --cpu=%PLATFORM% %MODE% - nmake - botan-test - nmake install diff --git a/src/scripts/dist.py b/src/scripts/dist.py index 224f01395..9ec0e6738 100755 --- a/src/scripts/dist.py +++ b/src/scripts/dist.py @@ -3,7 +3,7 @@ """ Release script for botan (http://botan.randombit.net/) -(C) 2011, 2012, 2013, 2015 Jack Lloyd +(C) 2011, 2012, 2013, 2015, 2016 Jack Lloyd Botan is released under the Simplified BSD License (see license.txt) """ @@ -218,30 +218,51 @@ def main(args = None): version_file = os.path.join(output_basename, 'botan_version.py') - if os.access(version_file, os.R_OK): - # rewrite botan_version.py - - contents = open(version_file).readlines() - - def content_rewriter(): - for line in contents: - if line == 'release_vc_rev = None\n': - yield 'release_vc_rev = \'git:%s\'\n' % (rev_id) - elif line == 'release_datestamp = 0\n': - yield 'release_datestamp = %d\n' % (rel_date) - elif line == "release_type = \'unreleased\'\n": - if args[0] == 'snapshot': - yield "release_type = 'snapshot'\n" - else: - yield "release_type = 'released'\n" - else: - yield line - - open(version_file, 'w').write(''.join(list(content_rewriter()))) - else: + if os.access(version_file, os.R_OK) == False: logging.error('Cannot read %s' % (version_file)) return 2 + # rewrite botan_version.py + + contents = open(version_file).readlines() + + version_re = re.compile('release_(major|minor|patch) = ([0-9]+)') + version_parts = target_version.split('.') + assert len(version_parts) == 3 + + def content_rewriter(): + for line in contents: + + if target_version != 'HEAD': + match = version_re.match(line) + if match: + name_to_idx = { + 'major': 0, + 'minor': 1, + 'patch': 2 + } + in_tag = int(version_parts[name_to_idx[match.group(1)]]) + in_file = int(match.group(2)) + + if in_tag != in_file: + logging.error('Version number part "%s" in botan_version.py does not match tag %s' % + (match.group(1), target_version)) + raise Exception('Bad botan_version.py') + + if line == 'release_vc_rev = None\n': + yield 'release_vc_rev = \'git:%s\'\n' % (rev_id) + elif line == 'release_datestamp = 0\n': + yield 'release_datestamp = %d\n' % (rel_date) + elif line == "release_type = \'unreleased\'\n": + if args[0] == 'snapshot': + yield "release_type = 'snapshot'\n" + else: + yield "release_type = 'released'\n" + else: + yield line + + open(version_file, 'w').write(''.join(list(content_rewriter()))) + try: os.makedirs(options.output_dir) except OSError as e: @@ -323,5 +344,5 @@ if __name__ == '__main__': except Exception as e: logging.error(e) import traceback - logging.info(traceback.format_exc()) + logging.debug(traceback.format_exc()) sys.exit(1) |