Browse Source

Breadcrumbs for assertions

default_compile_flags
vector-of-bool 4 years ago
parent
commit
3bfb0c131d
3 changed files with 7 additions and 2 deletions
  1. +3
    -0
      src/dds.main.cpp
  2. +3
    -2
      src/dds/repo/repo.cpp
  3. +1
    -0
      src/dds/source/dist.cpp

+ 3
- 0
src/dds.main.cpp View File

auto if_exists_action auto if_exists_action
= force.Get() ? dds::if_exists::replace : dds::if_exists::throw_exc; = force.Get() ? dds::if_exists::replace : dds::if_exists::throw_exc;
for (std::string_view tgz_where : sdist_paths.Get()) { for (std::string_view tgz_where : sdist_paths.Get()) {
neo_assertion_breadcrumbs("Importing sdist", tgz_where);
auto tmp_sd auto tmp_sd
= (tgz_where.starts_with("http://") || tgz_where.starts_with("https://")) = (tgz_where.starts_with("http://") || tgz_where.starts_with("https://"))
? dds::download_expand_sdist_targz(tgz_where) ? dds::download_expand_sdist_targz(tgz_where)
: dds::expand_sdist_targz(tgz_where); : dds::expand_sdist_targz(tgz_where);
neo_assertion_breadcrumbs("Importing from temporary directory",
tmp_sd.tmpdir.path());
repo.add_sdist(tmp_sd.sdist, if_exists_action); repo.add_sdist(tmp_sd.sdist, if_exists_action);
} }
if (import_stdin) { if (import_stdin) {

+ 3
- 2
src/dds/repo/repo.cpp View File

} }


void repository::add_sdist(const sdist& sd, if_exists ife_action) { void repository::add_sdist(const sdist& sd, if_exists ife_action) {
neo_assertion_breadcrumbs("Importing sdist archive", sd.manifest.pkg_id.to_string());
if (!_write_enabled) { if (!_write_enabled) {
dds_log( dds_log(
critical, critical,
| ranges::views::transform([](const sdist& sd) { return sd.manifest.pkg_id; }); | ranges::views::transform([](const sdist& sd) { return sd.manifest.pkg_id; });
auto avail = ctlg.by_name(name); auto avail = ctlg.by_name(name);
auto all = ranges::views::concat(mine, avail) | ranges::to_vector; auto all = ranges::views::concat(mine, avail) | ranges::to_vector;
ranges::sort(all, std::less<>{});
ranges::unique(all, std::less<>{});
ranges::sort(all, std::less{});
ranges::unique(all, std::less{});
return all; return all;
}, },
[&](const package_id& pkg_id) { [&](const package_id& pkg_id) {

+ 1
- 0
src/dds/source/dist.cpp View File

} }


temporary_sdist dds::expand_sdist_targz(path_ref targz_path) { temporary_sdist dds::expand_sdist_targz(path_ref targz_path) {
neo_assertion_breadcrumbs("Expanding sdist targz file", targz_path.string());
auto infile = open(targz_path, std::ios::binary | std::ios::in); auto infile = open(targz_path, std::ios::binary | std::ios::in);
return expand_sdist_from_istream(infile, targz_path.string()); return expand_sdist_from_istream(infile, targz_path.string());
} }

Loading…
Cancel
Save