1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

nix-env->nix profile prioirty: use queryMetaInt

This commit is contained in:
Eli Kogan-Wang 2023-09-10 15:18:55 +02:00
parent 46c665e34e
commit 9e58b88084

View file

@ -187,16 +187,7 @@ struct ProfileManifest
for (auto & packageInfo : packageInfos) { for (auto & packageInfo : packageInfos) {
ProfileElement element; ProfileElement element;
element.storePaths = {packageInfo.queryOutPath()}; element.storePaths = {packageInfo.queryOutPath()};
Value * priorityV = drvInfo.queryMeta("priority"); element.priority = packageInfo.queryMetaInt("priority", defaultPriority);
if (priorityV && priorityV->type() == nString) {
auto result = std::from_chars(
priorityV->str().data(),
priorityV->str().data() + priorityV->str().size(),
element.priority);
if (result.ec != std::errc()) {
throw Error("profile manifest '%s' has invalid priority '%s'", manifestPath, priorityV->str());
}
}
addElement(std::move(element)); addElement(std::move(element));
} }
} }