瀏覽代碼

Central location for pkg catalog db file

default_compile_flags
vector-of-bool 3 年之前
父節點
當前提交
bcf2516533
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. +3
    -0
      src/dds/catalog/catalog.cpp
  2. +2
    -0
      src/dds/catalog/catalog.hpp

+ 3
- 0
src/dds/catalog/catalog.cpp 查看文件

@@ -6,6 +6,7 @@
#include <dds/error/errors.hpp>
#include <dds/solve/solve.hpp>
#include <dds/util/log.hpp>
#include <dds/util/paths.hpp>

#include <json5/parse_data.hpp>
#include <neo/assert.hpp>
@@ -279,6 +280,8 @@ void ensure_migrated(nsql::database& db) {

} // namespace

fs::path catalog::default_path() noexcept { return dds_data_dir() / "catalog.db"; }

catalog catalog::open(const std::string& db_path) {
if (db_path != ":memory:") {
auto pardir = fs::weakly_canonical(db_path).parent_path();

+ 2
- 0
src/dds/catalog/catalog.hpp 查看文件

@@ -32,6 +32,8 @@ public:
static catalog open(const std::string& db_path);
static catalog open(path_ref db_path) { return open(db_path.string()); }

static fs::path default_path() noexcept;

void store(const package_info& info);
std::optional<package_info> get(const package_id& id) const noexcept;


Loading…
取消
儲存