|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
struct repo_where_flag : path_flag { |
|
|
|
|
|
repo_where_flag(args::Group& grp) |
|
|
|
|
|
|
|
|
struct repo_path_flag : path_flag { |
|
|
|
|
|
repo_path_flag(args::Group& grp) |
|
|
: path_flag{grp, |
|
|
: path_flag{grp, |
|
|
"dir", |
|
|
"dir", |
|
|
"Path to the DDS repository directory", |
|
|
"Path to the DDS repository directory", |
|
|
|
|
|
|
|
|
cli_catalog& parent; |
|
|
cli_catalog& parent; |
|
|
args::Command cmd{parent.cat_group, "get", "Obtain an sdist from a catalog listing"}; |
|
|
args::Command cmd{parent.cat_group, "get", "Obtain an sdist from a catalog listing"}; |
|
|
|
|
|
|
|
|
catalog_path_flag path{cmd}; |
|
|
|
|
|
|
|
|
catalog_path_flag path{cmd}; |
|
|
|
|
|
|
|
|
|
|
|
path_flag out{cmd, |
|
|
|
|
|
"out", |
|
|
|
|
|
"The directory where the source distributions will be placed", |
|
|
|
|
|
{"out-dir", 'o'}, |
|
|
|
|
|
dds::fs::current_path()}; |
|
|
|
|
|
|
|
|
args::PositionalList<std::string> requirements{cmd, |
|
|
args::PositionalList<std::string> requirements{cmd, |
|
|
"requirement", |
|
|
"requirement", |
|
|
"The package IDs to obtain"}; |
|
|
"The package IDs to obtain"}; |
|
|
|
|
|
|
|
|
auto info = cat.get(id); |
|
|
auto info = cat.get(id); |
|
|
if (!info) { |
|
|
if (!info) { |
|
|
throw std::runtime_error( |
|
|
throw std::runtime_error( |
|
|
fmt::format("No package in the catalog matched the given ID")); |
|
|
|
|
|
|
|
|
fmt::format("No package in the catalog matched the ID '{}'", req)); |
|
|
} |
|
|
} |
|
|
dds::get_package_sdist(*info); |
|
|
|
|
|
|
|
|
auto tsd = dds::get_package_sdist(*info); |
|
|
|
|
|
auto out_path = out.Get(); |
|
|
|
|
|
auto dest = out_path / id.to_string(); |
|
|
|
|
|
spdlog::info("Create sdist at {}", dest.string()); |
|
|
|
|
|
dds::fs::remove_all(dest); |
|
|
|
|
|
dds::safe_rename(tsd.sdist.path, dest); |
|
|
} |
|
|
} |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
args::Command cmd{base.cmd_group, "repo", "Manage the package repository"}; |
|
|
args::Command cmd{base.cmd_group, "repo", "Manage the package repository"}; |
|
|
common_flags _common{cmd}; |
|
|
common_flags _common{cmd}; |
|
|
|
|
|
|
|
|
repo_where_flag where{cmd}; |
|
|
|
|
|
|
|
|
repo_path_flag where{cmd}; |
|
|
|
|
|
|
|
|
args::Group repo_group{cmd, "Repo subcommands"}; |
|
|
args::Group repo_group{cmd, "Repo subcommands"}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
common_project_flags project{cmd}; |
|
|
common_project_flags project{cmd}; |
|
|
|
|
|
|
|
|
repo_where_flag repo_where{cmd}; |
|
|
|
|
|
args::Flag force{cmd, |
|
|
|
|
|
|
|
|
repo_path_flag repo_where{cmd}; |
|
|
|
|
|
args::Flag force{cmd, |
|
|
"replace-if-exists", |
|
|
"replace-if-exists", |
|
|
"Replace an existing export in the repository", |
|
|
"Replace an existing export in the repository", |
|
|
{"replace"}}; |
|
|
{"replace"}}; |
|
|
|
|
|
|
|
|
"Ensure we have local copies of the project dependencies"}; |
|
|
"Ensure we have local copies of the project dependencies"}; |
|
|
common_flags _common{cmd}; |
|
|
common_flags _common{cmd}; |
|
|
|
|
|
|
|
|
repo_where_flag repo_where{cmd}; |
|
|
|
|
|
path_flag remote_listing_file{ |
|
|
|
|
|
|
|
|
repo_path_flag repo_where{cmd}; |
|
|
|
|
|
path_flag remote_listing_file{ |
|
|
cmd, |
|
|
cmd, |
|
|
"remote-listing", |
|
|
"remote-listing", |
|
|
"Path to a file containing listing of remote sdists and how to obtain them", |
|
|
"Path to a file containing listing of remote sdists and how to obtain them", |
|
|
|
|
|
|
|
|
"If specified, will not generate an INDEX.lmi", |
|
|
"If specified, will not generate an INDEX.lmi", |
|
|
{"skip-lmi"}}; |
|
|
{"skip-lmi"}}; |
|
|
|
|
|
|
|
|
repo_where_flag repo_where{cmd}; |
|
|
|
|
|
|
|
|
repo_path_flag repo_where{cmd}; |
|
|
|
|
|
|
|
|
toolchain_flag tc_filepath{cmd}; |
|
|
toolchain_flag tc_filepath{cmd}; |
|
|
|
|
|
|