about summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-01-13T19·50+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-01-13T19·50+0000
commitafe23b5f385901ba5972ce88b2f053526c5097a9 (patch)
treefc65ae5a14e7260f130cd4417d7069b0ededdc60 /src/nix-store
parentf25f9000451ec5b9fb3221cdf2a297fe24ab7357 (diff)
* nix-pack-closure: store the top-level store paths in the closure.
* nix-unpack-closure: extract the top-level paths from the closure and
  print them on stdout.  This allows them to be installed, e.g.,
  "nix-env -i $(nix-unpack-closure)".  (NIX-64)

Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 701e8397427b..f0b3f5b615f3 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -296,7 +296,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
 {
     enum { qOutputs, qRequisites, qReferences, qReferrers
          , qReferrersClosure, qDeriver, qBinding, qHash
-         , qTree, qGraph } query = qOutputs;
+         , qTree, qGraph, qResolve } query = qOutputs;
     bool useOutput = false;
     bool includeOutputs = false;
     bool forceRealise = false;
@@ -320,6 +320,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
         else if (*i == "--hash") query = qHash;
         else if (*i == "--tree") query = qTree;
         else if (*i == "--graph") query = qGraph;
+        else if (*i == "--resolve") query = qResolve;
         else if (*i == "--use-output" || *i == "-u") useOutput = true;
         else if (*i == "--force-realise" || *i == "-f") forceRealise = true;
         else if (*i == "--include-outputs") includeOutputs = true;
@@ -410,6 +411,13 @@ static void opQuery(Strings opFlags, Strings opArgs)
             break;
         }
 
+        case qResolve: {
+            for (Strings::iterator i = opArgs.begin();
+                 i != opArgs.end(); ++i)
+                cout << format("%1%\n") % fixPath(*i);
+            break;
+        }
+            
         default:
             abort();
     }