Browse Source

A few remaining code mentions of "catalog"

default_compile_flags
vector-of-bool 3 years ago
parent
commit
a37525486d
9 changed files with 12 additions and 13 deletions
  1. +2
    -2
      src/dds/cli/cmd/build.cpp
  2. +1
    -1
      src/dds/cli/cmd/build_deps.cpp
  3. +1
    -1
      src/dds/cli/cmd/pkg_get.cpp
  4. +1
    -1
      src/dds/cli/cmd/pkg_repo_add.cpp
  5. +1
    -1
      src/dds/cli/cmd/pkg_repo_ls.cpp
  6. +1
    -1
      src/dds/cli/cmd/pkg_repo_update.cpp
  7. +1
    -1
      src/dds/cli/options.cpp
  8. +1
    -1
      src/dds/cli/options.hpp
  9. +3
    -4
      src/dds/pkg/db.test.cpp

+ 2
- 2
src/dds/cli/cmd/build.cpp View File



int build(const options& opts) { int build(const options& opts) {
if (!opts.build.add_repos.empty()) { if (!opts.build.add_repos.empty()) {
auto cat = opts.open_catalog();
auto cat = opts.open_pkg_db();
for (auto& str : opts.build.add_repos) { for (auto& str : opts.build.add_repos) {
auto repo = pkg_remote::connect(str); auto repo = pkg_remote::connect(str);
repo.store(cat.database()); repo.store(cat.database());
} }


if (opts.build.update_repos || !opts.build.add_repos.empty()) { if (opts.build.update_repos || !opts.build.add_repos.empty()) {
update_all_remotes(opts.open_catalog().database());
update_all_remotes(opts.open_pkg_db().database());
} }


auto builder = create_project_builder(opts); auto builder = create_project_builder(opts);

+ 1
- 1
src/dds/cli/cmd/build_deps.cpp View File



auto all_deps = ranges::views::concat(all_file_deps, cmd_deps) | ranges::to_vector; auto all_deps = ranges::views::concat(all_file_deps, cmd_deps) | ranges::to_vector;


auto cat = opts.open_catalog();
auto cat = opts.open_pkg_db();
dds::pkg_cache::with_cache( // dds::pkg_cache::with_cache( //
opts.pkg_cache_dir.value_or(pkg_cache::default_local_path()), opts.pkg_cache_dir.value_or(pkg_cache::default_local_path()),
dds::pkg_cache_flags::write_lock | dds::pkg_cache_flags::create_if_absent, dds::pkg_cache_flags::write_lock | dds::pkg_cache_flags::create_if_absent,

+ 1
- 1
src/dds/cli/cmd/pkg_get.cpp View File

namespace dds::cli::cmd { namespace dds::cli::cmd {


static int _pkg_get(const options& opts) { static int _pkg_get(const options& opts) {
auto cat = opts.open_catalog();
auto cat = opts.open_pkg_db();
for (const auto& item : opts.pkg.get.pkgs) { for (const auto& item : opts.pkg.get.pkgs) {
auto id = pkg_id::parse(item); auto id = pkg_id::parse(item);
dds::dym_target dym; dds::dym_target dym;

+ 1
- 1
src/dds/cli/cmd/pkg_repo_add.cpp View File

namespace dds::cli::cmd { namespace dds::cli::cmd {


static int _pkg_repo_add(const options& opts) { static int _pkg_repo_add(const options& opts) {
auto cat = opts.open_catalog();
auto cat = opts.open_pkg_db();
auto repo = pkg_remote::connect(opts.pkg.repo.add.url); auto repo = pkg_remote::connect(opts.pkg.repo.add.url);
repo.store(cat.database()); repo.store(cat.database());
if (opts.pkg.repo.add.update) { if (opts.pkg.repo.add.update) {

+ 1
- 1
src/dds/cli/cmd/pkg_repo_ls.cpp View File

namespace dds::cli::cmd { namespace dds::cli::cmd {


static int _pkg_repo_ls(const options& opts) { static int _pkg_repo_ls(const options& opts) {
auto pkg_db = opts.open_catalog();
auto pkg_db = opts.open_pkg_db();
neo::sqlite3::database_ref db = pkg_db.database(); neo::sqlite3::database_ref db = pkg_db.database();


auto st = db.prepare("SELECT name, remote_url, db_mtime FROM dds_pkg_remotes"); auto st = db.prepare("SELECT name, remote_url, db_mtime FROM dds_pkg_remotes");

+ 1
- 1
src/dds/cli/cmd/pkg_repo_update.cpp View File

namespace dds::cli::cmd { namespace dds::cli::cmd {


static int _pkg_repo_update(const options& opts) { static int _pkg_repo_update(const options& opts) {
update_all_remotes(opts.open_catalog().database());
update_all_remotes(opts.open_pkg_db().database());
return 0; return 0;
} }



+ 1
- 1
src/dds/cli/options.cpp View File

setup{*this}.do_setup(parser); setup{*this}.do_setup(parser);
} }


pkg_db dds::cli::options::open_catalog() const {
pkg_db dds::cli::options::open_pkg_db() const {
return pkg_db::open(this->pkg_db_dir.value_or(pkg_db::default_path())); return pkg_db::open(this->pkg_db_dir.value_or(pkg_db::default_path()));
} }



+ 1
- 1
src/dds/cli/options.hpp View File

* @brief Open the package pkg_db based on the user-specified options. * @brief Open the package pkg_db based on the user-specified options.
* @return pkg_db * @return pkg_db
*/ */
pkg_db open_catalog() const;
pkg_db open_pkg_db() const;
/** /**
* @brief Load a dds toolchain as specified by the user, or a default. * @brief Load a dds toolchain as specified by the user, or a default.
* @return dds::toolchain * @return dds::toolchain

+ 3
- 4
src/dds/pkg/db.test.cpp View File

dds::fs::remove_all(subdir); dds::fs::remove_all(subdir);
} }


class catalog_test_case {
public:
struct pkg_db_test_case {
dds::pkg_db db = dds::pkg_db::open(":memory:"s); dds::pkg_db db = dds::pkg_db::open(":memory:"s);
}; };


TEST_CASE_METHOD(catalog_test_case, "Store a simple package") {
TEST_CASE_METHOD(pkg_db_test_case, "Store a simple package") {
db.store(dds::pkg_listing{ db.store(dds::pkg_listing{
dds::pkg_id{"foo", semver::version::parse("1.2.3")}, dds::pkg_id{"foo", semver::version::parse("1.2.3")},
{}, {},
CHECK(info->remote_pkg.to_url_string() == "git+http://example.com#develop"); CHECK(info->remote_pkg.to_url_string() == "git+http://example.com#develop");
} }


TEST_CASE_METHOD(catalog_test_case, "Package requirements") {
TEST_CASE_METHOD(pkg_db_test_case, "Package requirements") {
db.store(dds::pkg_listing{ db.store(dds::pkg_listing{
dds::pkg_id{"foo", semver::version::parse("1.2.3")}, dds::pkg_id{"foo", semver::version::parse("1.2.3")},
{ {

Loading…
Cancel
Save