From b68e3241b656a6ef65114c6e5d0fefc9792c4f02 Mon Sep 17 00:00:00 2001 From: Vaclav Blazek Date: Mon, 13 Mar 2023 15:31:45 +0100 Subject: [PATCH] fixed symlinking problem on Boost.Filesystem 1.74+ --- mapproxy/src/setup-resource/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mapproxy/src/setup-resource/main.cpp b/mapproxy/src/setup-resource/main.cpp index cf78069..bb6275e 100644 --- a/mapproxy/src/setup-resource/main.cpp +++ b/mapproxy/src/setup-resource/main.cpp @@ -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); @@ -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); } @@ -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); }());