|
|
@@ -7,15 +7,12 @@ |
|
|
|
using namespace dds; |
|
|
|
|
|
|
|
package_manifest package_manifest::load_from_file(const fs::path& fpath) { |
|
|
|
auto kvs = lm::parse_file(fpath); |
|
|
|
auto kvs = lm::parse_file(fpath); |
|
|
|
package_manifest ret; |
|
|
|
for (auto& pair : kvs.items()) { |
|
|
|
if (pair.key() == "Name") { |
|
|
|
ret.name = pair.value(); |
|
|
|
} else { |
|
|
|
throw std::runtime_error( |
|
|
|
fmt::format("Unknown key in file '{}': {}", fpath.string(), pair.key())); |
|
|
|
} |
|
|
|
} |
|
|
|
lm::read(fmt::format("Reading package manifest '{}'", fpath.string()), |
|
|
|
kvs, |
|
|
|
lm::read_opt("Name", ret.name), |
|
|
|
lm::read_opt("Version", ret.version), |
|
|
|
lm::reject_unknown()); |
|
|
|
return ret; |
|
|
|
} |