1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 12:41:00 +01:00

Merged trunk R9751 back in.

This commit is contained in:
Wouter den Breejen 2007-11-19 11:47:41 +00:00
parent 4e11da960c
commit 55b07d65b1
16 changed files with 294 additions and 20 deletions

View file

@ -588,12 +588,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;
}