Workaround for boost::filesystem and Visual Studio on Windows

This commit is contained in:
Michael Friedrich 2019-05-10 13:38:12 +02:00
parent 6cce9c0fdd
commit 6c9c65323e
2 changed files with 5 additions and 2 deletions

View 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.

View 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;