diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-01-15T14·43+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-01-15T14·43+0000 |
commit | 55e11bc0d3e3c440503ee71d21c3ef5e34431cbb (patch) | |
tree | 7b13547e65a0f29e147a4fc759401e5dac18fec7 /src/nix-env | |
parent | 9a404e45c9e8257e2d353d569e189a4b003159b5 (diff) |
* 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.
Diffstat (limited to 'src/nix-env')
-rw-r--r-- | src/nix-env/main.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index f0877b058624..5c27a89fcd75 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -600,9 +600,15 @@ static void opQuery(Globals & globals, DrvInfos installed; 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) { 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' : '-') % i->second.name; } |