Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ALPM DB over HTTP #30

Merged
merged 10 commits into from
May 8, 2024
13 changes: 8 additions & 5 deletions daemon/persistence/box/export/AlpmDBExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@
#include <parallel_hashmap/phmap.h>
#include <string_view>
#include <system_error>
#include <thread>
#include <unordered_map>
#include <utility>

namespace bxt::Persistence::Box {

// Creates the symlink relative to target
std::expected<void, FsError>
create_relative_symlink(const std::filesystem::path& target,
const std::filesystem::path& link) {
if (std::filesystem::is_symlink(link)) { return {}; }
std::error_code ec;

if (std::filesystem::exists(link)) {
ec.assign(static_cast<int>(std::errc::file_exists),
std::generic_category());
return bxt::make_error<FsError>(ec);
}
if (ec) { return bxt::make_error<FsError>(ec); }
LordTermor marked this conversation as resolved.
Show resolved Hide resolved

const auto relative_target =
std::filesystem::relative(target, link.parent_path(), ec);
if (ec) { return bxt::make_error<FsError>(ec); }
Expand Down