diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2007-02-21T14·31+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2007-02-21T14·31+0000 |
commit | 46e0919ced4646004cc0701b188d0a68e24e8924 (patch) | |
tree | 3262f8068c38489029753c528a123b2c685aea68 /src/nix-store/nix-store.cc | |
parent | 6c9fdb17fbda181fc09a9ce1f49662ef522d006b (diff) |
* `nix-store --export --sign': sign the Nix archive using the RSA key
in /nix/etc/nix/signing-key.sec
Diffstat (limited to '')
-rw-r--r-- | src/nix-store/nix-store.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 821124324f47..7b56de7e4d64 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -640,10 +640,14 @@ static void opRestore(Strings opFlags, Strings opArgs) static void opExport(Strings opFlags, Strings opArgs) { - if (!opFlags.empty()) throw UsageError("unknown flag"); - + bool sign = false; + for (Strings::iterator i = opFlags.begin(); + i != opFlags.end(); ++i) + if (*i == "--sign") sign = true; + else throw UsageError(format("unknown flag `%1%'") % *i); + FdSink sink(STDOUT_FILENO); - store->exportPath(*opArgs.begin(), false, sink); + store->exportPath(*opArgs.begin(), sign, sink); } |