about summary refs log tree commit diff
path: root/src/nix.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-09T15·02+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-09T15·02+0000
commit2b95a9dc05d0a943859ba92bb301c294473758f1 (patch)
tree7eb1a6af395553a2c9af6a072820bcaf3f040e76 /src/nix.cc
parent9a99dc736d814f41d2b3ceb92da2435ae2dd5632 (diff)
* When computing the set of paths referenced by an expression, also
  include the paths of the subterms.

Diffstat (limited to 'src/nix.cc')
-rw-r--r--src/nix.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nix.cc b/src/nix.cc
index f3549ead8442..d6f2db4fefd1 100644
--- a/src/nix.cc
+++ b/src/nix.cc
@@ -96,7 +96,10 @@ static void opInstall(Strings opFlags, Strings opArgs)
 
     for (Strings::iterator it = opArgs.begin();
          it != opArgs.end(); it++)
-        realiseFState(termFromHash(argToHash(*it)));
+    {
+        StringSet paths;
+        realiseFState(termFromHash(argToHash(*it)), paths);
+    }
 }
 
 
@@ -160,8 +163,10 @@ static void opQuery(Strings opFlags, Strings opArgs)
             break;
 
         case qRefs: {
-            Strings refs = fstateRefs(realiseFState(termFromHash(hash)));
-            for (Strings::iterator j = refs.begin(); 
+            StringSet refs;
+            FState fs = ATmake("Include(<str>)", ((string) hash).c_str());
+            fstateRefs(realiseFState(fs, refs), refs);
+            for (StringSet::iterator j = refs.begin(); 
                  j != refs.end(); j++)
                 cout << format("%s\n") % *j;
             break;