From 658886ec4f1c78c8ccee5271736345e55ce158ab Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 1 Nov 2014 20:09:18 +0000 Subject: [PATCH] Fixed loot_masterlist_update errors on Linux. It was due to a lack of OpenSSL support in the libgit2 being built, which also needs the threading system to be initialised, even if threading support was not built... --- .travis.yml | 3 ++- src/backend/git.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf1b9fb4..00843732 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,10 @@ cache: apt before_install: # Need Boost 1.54+, which isn't in the 12.04 repositories - install from a PPA. + # Also need the OpenSSL dev package, for git clone from HTTPS URLs support. - sudo add-apt-repository ppa:boost-latest/ppa -y - sudo apt-get update -qq - - sudo apt-get install libboost-log1.55-dev libboost-date-time1.55-dev libboost-thread1.55-dev libboost-filesystem1.55-dev libboost-locale1.55-dev libboost-iostreams1.55-dev + - sudo apt-get install libboost-log1.55-dev libboost-date-time1.55-dev libboost-thread1.55-dev libboost-filesystem1.55-dev libboost-locale1.55-dev libboost-iostreams1.55-dev libssl-dev install: # Currently inside the cloned repo path. diff --git a/src/backend/git.cpp b/src/backend/git.cpp index 60a7ae2c..15f30de8 100644 --- a/src/backend/git.cpp +++ b/src/backend/git.cpp @@ -40,7 +40,6 @@ namespace fs = boost::filesystem; namespace lc = boost::locale; namespace loot { - // Removes the read-only flag from some files in git repositories created by libgit2. void FixRepoPermissions(const fs::path& path) { BOOST_LOG_TRIVIAL(trace) << "Recursively setting write permission on directory: " << path; @@ -65,7 +64,10 @@ namespace loot { merge_head(nullptr), tree(nullptr), diff(nullptr), - buf({0}) {} + buf({0}) { + // Init threading system and OpenSSL (for Linux builds). + git_threads_init(); + } ~git_handler() { string path; @@ -80,6 +82,8 @@ namespace loot { } catch (exception&) {} } + + git_threads_shutdown(); } void free() {