mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
nix-env->nix profile prioirty: use queryMetaInt
This commit is contained in:
parent
46c665e34e
commit
9e58b88084
1 changed files with 1 additions and 10 deletions
|
@ -187,16 +187,7 @@ struct ProfileManifest
|
|||
for (auto & packageInfo : packageInfos) {
|
||||
ProfileElement element;
|
||||
element.storePaths = {packageInfo.queryOutPath()};
|
||||
Value * priorityV = drvInfo.queryMeta("priority");
|
||||
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());
|
||||
}
|
||||
}
|
||||
element.priority = packageInfo.queryMetaInt("priority", defaultPriority);
|
||||
addElement(std::move(element));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue