Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fixed symlinking problem on Boost.Filesystem 1.74+
Browse files Browse the repository at this point in the history
  • Loading branch information
vaclavblazek committed Mar 13, 2023
1 parent e8e9e45 commit b68e324
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mapproxy/src/setup-resource/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ int SetupResource::run()
(utility::addExtension(datasetFileName
, "." + md5sum(dataset_))));

const auto rootDir(config.mapproxyDataRoot / datasetHome);
const auto rootDir(fs::absolute(datasetHome, config.mapproxyDataRoot));
const auto baseDatasetPath("original-dataset" / datasetFileName);
const auto datasetPath(rootDir / baseDatasetPath);

Expand All @@ -881,15 +881,18 @@ int SetupResource::run()

if (linkDataset_ == DatasetLink::relative) {
// relativize already absolute path
dst = dst.lexically_relative(rootDir / ".");
dst = dst.lexically_relative(rootDir / "file");
}

// link
LOG(info3) << " ln -s " << dst << " " << tmpDatasetPath;
fs::create_symlink(dst, tmpDatasetPath);
} else {
// copy (overwrite)
LOG(info4) << "Copying dataset to destination.";
utility::copy_file(dataset_, tmpDatasetPath, true);
LOG(info3)
<< " cp -av " << dataset_ << " " << tmpDatasetPath;
ds.copyFiles(datasetPath);
}

Expand All @@ -899,7 +902,8 @@ int SetupResource::run()
// commit
fs::rename(tmpRootDir, rootDir);
} else {
LOG(info4) << "Reusing existing dataset.";
LOG(info4) << "Reusing existing dataset from "
<< rootDir << ".";
}
return vrtWOPath(cm, rootDir);
}());
Expand Down

0 comments on commit b68e324

Please sign in to comment.