mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
* nix-env -i: instead of breaking package ties by version, break them
by priority and version install. That is, if there are multiple packages with the same name, then pick the package with the highest priority, and only use the version if there are multiple packages with the same priority. This makes it possible to mark specific versions/variant in Nixpkgs more or less desirable than others. A typical example would be a beta version of some package (e.g., "gcc-4.2.0rc1") which should not be installed even though it is the highest version, except when it is explicitly selected (e.g., "nix-env -i gcc-4.2.0rc1"). * Idem for nix-env -u, only the semantics are a bit trickier since we also need to take into account the priority of the currently installed package (we never upgrade to a lower priority, unless --always is given).
This commit is contained in:
parent
cbfac2fdcc
commit
a9d15d4f43
4 changed files with 54 additions and 13 deletions
|
@ -60,6 +60,15 @@ MetaInfo DrvInfo::queryMetaInfo(EvalState & state) const
|
|||
}
|
||||
|
||||
|
||||
string DrvInfo::queryMetaInfo(EvalState & state, const string & name) const
|
||||
{
|
||||
/* !!! evaluates all meta attributes => inefficient */
|
||||
MetaInfo meta = queryMetaInfo(state);
|
||||
MetaInfo::iterator i = meta.find(name);
|
||||
return i == meta.end() ? "" : i->second;
|
||||
}
|
||||
|
||||
|
||||
void DrvInfo::setMetaInfo(const MetaInfo & meta)
|
||||
{
|
||||
ATermMap metaAttrs;
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
string queryDrvPath(EvalState & state) const;
|
||||
string queryOutPath(EvalState & state) const;
|
||||
MetaInfo queryMetaInfo(EvalState & state) const;
|
||||
string queryMetaInfo(EvalState & state, const string & name) const;
|
||||
|
||||
void setDrvPath(const string & s)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue