diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index e86a0e4d49..e0b69f4163 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -196,16 +196,18 @@ set( ${LIBMAMBA_SOURCE_DIR}/validation/update_framework_v0_6.cpp ${LIBMAMBA_SOURCE_DIR}/validation/update_framework_v1.cpp ${LIBMAMBA_SOURCE_DIR}/validation/repo_checker.cpp - # C++ wrapping of libcurl - ${LIBMAMBA_SOURCE_DIR}/core/curl.cpp - # C++ wrapping of compression libs (zstd and bzlib) - ${LIBMAMBA_SOURCE_DIR}/core/compression.cpp + # Implementation of downloaders and mirrors + ${LIBMAMBA_SOURCE_DIR}/download/compression.hpp + ${LIBMAMBA_SOURCE_DIR}/download/compression.cpp + ${LIBMAMBA_SOURCE_DIR}/download/curl.hpp + ${LIBMAMBA_SOURCE_DIR}/download/curl.cpp + ${LIBMAMBA_SOURCE_DIR}/download/downloader_impl.hpp + ${LIBMAMBA_SOURCE_DIR}/download/downloader.cpp # Core API (low-level) ${LIBMAMBA_SOURCE_DIR}/core/singletons.cpp ${LIBMAMBA_SOURCE_DIR}/core/activation.cpp ${LIBMAMBA_SOURCE_DIR}/core/channel_context.cpp ${LIBMAMBA_SOURCE_DIR}/core/context.cpp - ${LIBMAMBA_SOURCE_DIR}/core/download.cpp ${LIBMAMBA_SOURCE_DIR}/core/download_progress_bar.cpp ${LIBMAMBA_SOURCE_DIR}/core/environments_manager.cpp ${LIBMAMBA_SOURCE_DIR}/core/error_handling.cpp @@ -325,7 +327,6 @@ set( ${LIBMAMBA_INCLUDE_DIR}/mamba/core/channel_context.hpp ${LIBMAMBA_INCLUDE_DIR}/mamba/core/palette.hpp ${LIBMAMBA_INCLUDE_DIR}/mamba/core/context.hpp - ${LIBMAMBA_INCLUDE_DIR}/mamba/core/download.hpp ${LIBMAMBA_INCLUDE_DIR}/mamba/core/download_progress_bar.hpp ${LIBMAMBA_INCLUDE_DIR}/mamba/core/environments_manager.hpp ${LIBMAMBA_INCLUDE_DIR}/mamba/core/error_handling.hpp @@ -388,10 +389,6 @@ set( ${LIBMAMBA_SOURCE_DIR}/solv-cpp/solver.hpp ${LIBMAMBA_SOURCE_DIR}/solv-cpp/repo.hpp ${LIBMAMBA_SOURCE_DIR}/solv-cpp/transaction.hpp - # C++ wrapping of compression libs (zstd and bzlib) - ${LIBMAMBA_SOURCE_DIR}/core/compression.hpp - # C++ wrapping of libcurl - ${LIBMAMBA_SOURCE_DIR}/core/curl.hpp ) # Targets and link diff --git a/libmamba/include/mamba/core/download_progress_bar.hpp b/libmamba/include/mamba/core/download_progress_bar.hpp index 2d1dd39d6b..8e7235292a 100644 --- a/libmamba/include/mamba/core/download_progress_bar.hpp +++ b/libmamba/include/mamba/core/download_progress_bar.hpp @@ -12,8 +12,8 @@ #include #include "mamba/core/context.hpp" -#include "mamba/core/download.hpp" #include "mamba/core/package_fetcher.hpp" +#include "mamba/download/downloader.hpp" namespace mamba { diff --git a/libmamba/include/mamba/core/package_fetcher.hpp b/libmamba/include/mamba/core/package_fetcher.hpp index 9add39ab72..7995b120db 100644 --- a/libmamba/include/mamba/core/package_fetcher.hpp +++ b/libmamba/include/mamba/core/package_fetcher.hpp @@ -9,11 +9,11 @@ #include -#include "mamba/core/download.hpp" #include "mamba/core/package_cache.hpp" #include "mamba/core/package_handling.hpp" +#include "mamba/core/package_info.hpp" #include "mamba/core/thread_utils.hpp" -#include "mamba/specs/package_info.hpp" +#include "mamba/download/downloader.hpp" namespace mamba { diff --git a/libmamba/include/mamba/core/subdirdata.hpp b/libmamba/include/mamba/core/subdirdata.hpp index bd5ff2361a..cfd69f1cff 100644 --- a/libmamba/include/mamba/core/subdirdata.hpp +++ b/libmamba/include/mamba/core/subdirdata.hpp @@ -12,10 +12,10 @@ #include -#include "mamba/core/download.hpp" #include "mamba/core/error_handling.hpp" #include "mamba/core/package_cache.hpp" #include "mamba/core/util.hpp" +#include "mamba/download/downloader.hpp" #include "mamba/fs/filesystem.hpp" namespace mamba diff --git a/libmamba/include/mamba/core/download.hpp b/libmamba/include/mamba/download/downloader.hpp similarity index 98% rename from libmamba/include/mamba/core/download.hpp rename to libmamba/include/mamba/download/downloader.hpp index 7e4343c986..82217e704a 100644 --- a/libmamba/include/mamba/core/download.hpp +++ b/libmamba/include/mamba/download/downloader.hpp @@ -4,8 +4,8 @@ // // The full license is in the file LICENSE, distributed with this software. -#ifndef MAMBA_CORE_DOWNLOAD_HPP -#define MAMBA_CORE_DOWNLOAD_HPP +#ifndef MAMBA_DL_DOWNLOADER_HPP +#define MAMBA_DL_DOWNLOADER_HPP #include #include diff --git a/libmamba/src/api/channel_loader.cpp b/libmamba/src/api/channel_loader.cpp index ab1ee966e5..c89352982d 100644 --- a/libmamba/src/api/channel_loader.cpp +++ b/libmamba/src/api/channel_loader.cpp @@ -11,6 +11,7 @@ #include "mamba/core/pool.hpp" #include "mamba/core/prefix_data.hpp" #include "mamba/core/subdirdata.hpp" +#include "mamba/download/downloader.hpp" #include "mamba/solver/libsolv/repo_info.hpp" namespace mamba @@ -111,6 +112,8 @@ namespace mamba ctx, pool.channel_context(), channel, + // platform, + // channel.platform_url(platform).str(specs::CondaURL::Credentials::Show), package_caches, subdirs, error_list, diff --git a/libmamba/src/api/install.cpp b/libmamba/src/api/install.cpp index b8d9c76e35..c3348c7df4 100644 --- a/libmamba/src/api/install.cpp +++ b/libmamba/src/api/install.cpp @@ -18,7 +18,6 @@ #include "mamba/core/activation.hpp" #include "mamba/core/channel_context.hpp" #include "mamba/core/context.hpp" -#include "mamba/core/download.hpp" #include "mamba/core/env_lockfile.hpp" #include "mamba/core/environments_manager.hpp" #include "mamba/core/output.hpp" @@ -27,6 +26,7 @@ #include "mamba/core/solver.hpp" #include "mamba/core/transaction.hpp" #include "mamba/core/virtual_packages.hpp" +#include "mamba/download/downloader.hpp" #include "mamba/fs/filesystem.hpp" #include "mamba/util/path_manip.hpp" #include "mamba/util/string.hpp" diff --git a/libmamba/src/core/mirror.cpp b/libmamba/src/core/mirror.cpp index 3fbdc06b97..3ae56357ce 100644 --- a/libmamba/src/core/mirror.cpp +++ b/libmamba/src/core/mirror.cpp @@ -11,7 +11,7 @@ #include "mamba/util/string.hpp" #include "mamba/util/url_manip.hpp" -#include "curl.hpp" +#include "../download/curl.hpp" namespace mamba { diff --git a/libmamba/src/core/package_handling.cpp b/libmamba/src/core/package_handling.cpp index 6be5263a22..38b97ba797 100644 --- a/libmamba/src/core/package_handling.cpp +++ b/libmamba/src/core/package_handling.cpp @@ -18,10 +18,9 @@ #include "mamba/util/string.hpp" #include "mamba/validation/tools.hpp" +#include "../download/compression.hpp" #include "nlohmann/json.hpp" -#include "compression.hpp" - namespace mamba { ExtractOptions ExtractOptions::from_context(const Context& context) diff --git a/libmamba/src/core/compression.cpp b/libmamba/src/download/compression.cpp similarity index 100% rename from libmamba/src/core/compression.cpp rename to libmamba/src/download/compression.cpp diff --git a/libmamba/src/core/compression.hpp b/libmamba/src/download/compression.hpp similarity index 98% rename from libmamba/src/core/compression.hpp rename to libmamba/src/download/compression.hpp index 4a6180c8f3..b298573cd9 100644 --- a/libmamba/src/core/compression.hpp +++ b/libmamba/src/download/compression.hpp @@ -4,8 +4,8 @@ // // The full license is in the file LICENSE, distributed with this software. -#ifndef MAMBA_COMPRESSION_HPP -#define MAMBA_COMPRESSION_HPP +#ifndef MAMBA_DL_COMPRESSION_HPP +#define MAMBA_DL_COMPRESSION_HPP #include #include diff --git a/libmamba/src/core/curl.cpp b/libmamba/src/download/curl.cpp similarity index 100% rename from libmamba/src/core/curl.cpp rename to libmamba/src/download/curl.cpp diff --git a/libmamba/src/core/curl.hpp b/libmamba/src/download/curl.hpp similarity index 99% rename from libmamba/src/core/curl.hpp rename to libmamba/src/download/curl.hpp index 51431c7f10..e2518938c6 100644 --- a/libmamba/src/core/curl.hpp +++ b/libmamba/src/download/curl.hpp @@ -4,8 +4,8 @@ // // The full license is in the file LICENSE, distributed with this software. -#ifndef MAMBA_CURL_HPP -#define MAMBA_CURL_HPP +#ifndef MAMBA_DL_CURL_HPP +#define MAMBA_DL_CURL_HPP #include #include diff --git a/libmamba/src/core/download.cpp b/libmamba/src/download/downloader.cpp similarity index 99% rename from libmamba/src/core/download.cpp rename to libmamba/src/download/downloader.cpp index 568d9cbac9..8d8d3559d6 100644 --- a/libmamba/src/core/download.cpp +++ b/libmamba/src/download/downloader.cpp @@ -4,11 +4,11 @@ // // The full license is in the file LICENSE, distributed with this software. -#include "mamba/core/download.hpp" #include "mamba/core/invoke.hpp" #include "mamba/core/thread_utils.hpp" #include "mamba/core/util.hpp" #include "mamba/core/util_scope.hpp" +#include "mamba/download/downloader.hpp" #include "mamba/util/build.hpp" #include "mamba/util/environment.hpp" #include "mamba/util/iterator.hpp" @@ -17,7 +17,7 @@ #include "mamba/util/url_manip.hpp" #include "curl.hpp" -#include "download_impl.hpp" +#include "downloader_impl.hpp" namespace mamba { diff --git a/libmamba/src/core/download_impl.hpp b/libmamba/src/download/downloader_impl.hpp similarity index 98% rename from libmamba/src/core/download_impl.hpp rename to libmamba/src/download/downloader_impl.hpp index 77d5e0d686..67c39b07e0 100644 --- a/libmamba/src/core/download_impl.hpp +++ b/libmamba/src/download/downloader_impl.hpp @@ -4,13 +4,13 @@ // // The full license is in the file LICENSE, distributed with this software. -#ifndef MAMBA_CORE_DOWNLOAD_IMPL_HPP -#define MAMBA_CORE_DOWNLOAD_IMPL_HPP +#ifndef MAMBA_DL_DOWNLOADER_IMPL_HPP +#define MAMBA_DL_DOWNLOADER_IMPL_HPP #include #include -#include "mamba/core/download.hpp" +#include "mamba/download/downloader.hpp" #include "compression.hpp" #include "curl.hpp" diff --git a/libmamba/tests/CMakeLists.txt b/libmamba/tests/CMakeLists.txt index 2b265b96ab..53ba071416 100644 --- a/libmamba/tests/CMakeLists.txt +++ b/libmamba/tests/CMakeLists.txt @@ -60,13 +60,14 @@ set( src/validation/test_tools.cpp src/validation/test_update_framework_v0_6.cpp src/validation/test_update_framework_v1.cpp - # The un-triaged rest + # Implementation of downloaders and mirrors + src/download/test_downloader.cpp + # Core tests ../longpath.manifest src/core/test_activation.cpp src/core/test_channel_context.cpp src/core/test_configuration.cpp src/core/test_cpp.cpp - src/core/test_downloader.cpp src/core/test_env_file_reading.cpp src/core/test_environments_manager.cpp src/core/test_history.cpp diff --git a/libmamba/tests/src/core/test_downloader.cpp b/libmamba/tests/src/download/test_downloader.cpp similarity index 97% rename from libmamba/tests/src/core/test_downloader.cpp rename to libmamba/tests/src/download/test_downloader.cpp index fd0835db11..b3033b3546 100644 --- a/libmamba/tests/src/core/test_downloader.cpp +++ b/libmamba/tests/src/download/test_downloader.cpp @@ -6,7 +6,7 @@ #include -#include "mamba/core/download.hpp" +#include "mamba/download/downloader.hpp" #include "mambatests.hpp"