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

@@ -680,10 +680,13 @@ struct cli_repo {
auto if_exists_action
= force.Get() ? dds::if_exists::replace : dds::if_exists::throw_exc;
for (std::string_view tgz_where : sdist_paths.Get()) {
neo_assertion_breadcrumbs("Importing sdist", tgz_where);
auto tmp_sd
= (tgz_where.starts_with("http://") || tgz_where.starts_with("https://"))
? dds::download_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);
}
if (import_stdin) {

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

@@ -60,6 +60,7 @@ repository repository::_open_for_directory(bool writeable, path_ref dirpath) {
}

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) {
dds_log(
critical,
@@ -117,8 +118,8 @@ std::vector<package_id> repository::solve(const std::vector<dependency>& deps,
| ranges::views::transform([](const sdist& sd) { return sd.manifest.pkg_id; });
auto avail = ctlg.by_name(name);
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;
},
[&](const package_id& pkg_id) {

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

@@ -133,6 +133,7 @@ sdist sdist::from_directory(path_ref where) {
}

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);
return expand_sdist_from_istream(infile, targz_path.string());
}

Loading…
Cancel
Save