]> granicus.if.org Git - icinga2/commitdiff
Workaround for boost::filesystem and Visual Studio on Windows 7178/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 10 May 2019 11:38:12 +0000 (13:38 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 10 May 2019 11:38:12 +0000 (13:38 +0200)
doc/15-troubleshooting.md
lib/remote/configobjectutility.cpp

index 6f4a965a96f373c40e27913844bd72c55eb329fd..bf12e9d6d9fc323c4acd76171938f10d79c4e1a3 100644 (file)
@@ -840,7 +840,7 @@ echo "dbe0bef8-c72c-4cc9-9779-da7c4527c5b2" > active-stage
 like this. Note: This is deep down in the code, use with care!
 
 ```
-sed -i 's/ActiveStages\["_api"\].*/ActiveStages\["_api"\] = "dbe0bef8-c72c-4cc9-9779-da7c4527c5b2"/g' /var/lib/icinga2/api/packages/_api/active.conf
+sed -i 's/ActiveStages\["_api"\] = .*/ActiveStages\["_api"\] = "dbe0bef8-c72c-4cc9-9779-da7c4527c5b2"/g' /var/lib/icinga2/api/packages/_api/active.conf
 ```
 
 Restart Icinga 2.
index 9aeb30c06d2bf4f49eabb38c6cbafa9d35707f26..6b83eb2cf714120a1a99e8beaf3bba62a8c4c8b3 100644 (file)
@@ -44,9 +44,12 @@ void ConfigObjectUtility::RepairPackage(const String& package)
        /* Try to fix the active stage, whenever we find a directory in there.
         * This automatically heals packages < 2.11 which remained broken.
         */
+       String dir = ConfigPackageUtility::GetPackageDir() + "/" + package + "/";
+
        namespace fs = boost::filesystem;
 
-       fs::path path(ConfigPackageUtility::GetPackageDir() + "/" + package + "/");
+       /* Use iterators to workaround VS builds on Windows. */
+       fs::path path(dir.Begin(), dir.End());
 
        fs::recursive_directory_iterator end;