Skip to content
Snippets Groups Projects
Commit 55e11bc0 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

* In `nix-env --query --status', determine the `I' bit by looking at

  the output path of a derivation, not the path of its store
  expression.  This ensures that changes that affect the path of the
  store expression but not the output path, do not affect the
  `installed' state of a derivation.
parent 9a404e45
No related branches found
No related tags found
No related merge requests found
...@@ -600,9 +600,15 @@ static void opQuery(Globals & globals, ...@@ -600,9 +600,15 @@ static void opQuery(Globals & globals,
DrvInfos installed; DrvInfos installed;
queryInstalled(globals.state, installed, globals.linkPath); queryInstalled(globals.state, installed, globals.linkPath);
PathSet installedPaths; /* output paths of installed drvs */
for (DrvInfos::iterator i = installed.begin();
i != installed.end(); ++i)
installedPaths.insert(i->second.outPath);
for (DrvInfos::iterator i = drvs.begin(); i != drvs.end(); ++i) { for (DrvInfos::iterator i = drvs.begin(); i != drvs.end(); ++i) {
cout << format("%1%%2% %3%\n") cout << format("%1%%2% %3%\n")
% (installed.find(i->first) != installed.end() ? 'I' : '-') % (installedPaths.find(i->second.outPath)
!= installedPaths.end() ? 'I' : '-')
% (isValidPath(i->second.outPath) ? 'P' : '-') % (isValidPath(i->second.outPath) ? 'P' : '-')
% i->second.name; % i->second.name;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment