about summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-11-16T16·10+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-11-16T16·10+0000
commitc05783ad67ee95b5dd76d160efedc23b3acb0905 (patch)
tree6af260bdc891809ef1aa4d878d7f5452facc004f /src/nix-store
parent6784b14241c916943cd9b1b0fa0af66fb574605c (diff)
* nix-store --import: add a flag --require-signature.
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index a20ba81a6f..c919b0f25d 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -584,12 +584,17 @@ static void opExport(Strings opFlags, Strings opArgs)
 
 static void opImport(Strings opFlags, Strings opArgs)
 {
-    if (!opFlags.empty()) throw UsageError("unknown flag");
+    bool requireSignature = false;
+    for (Strings::iterator i = opFlags.begin();
+         i != opFlags.end(); ++i)
+        if (*i == "--require-signature") requireSignature = true;
+        else throw UsageError(format("unknown flag `%1%'") % *i);
+    
     if (!opArgs.empty()) throw UsageError("no arguments expected");
     
     FdSource source(STDIN_FILENO);
     while (readInt(source) == 1)
-        cout << format("%1%\n") % store->importPath(false, source) << std::flush;
+        cout << format("%1%\n") % store->importPath(requireSignature, source) << std::flush;
 }