* Export/import many paths in one go.

This commit is contained in:
Eelco Dolstra 2007-02-21 23:00:31 +00:00
parent 9da367b7d5
commit 0db450024d

View file

@ -625,7 +625,11 @@ static void opExport(Strings opFlags, Strings opArgs)
else throw UsageError(format("unknown flag `%1%'") % *i); else throw UsageError(format("unknown flag `%1%'") % *i);
FdSink sink(STDOUT_FILENO); FdSink sink(STDOUT_FILENO);
store->exportPath(*opArgs.begin(), sign, sink); for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); ++i) {
writeInt(1, sink);
store->exportPath(*i, sign, sink);
}
writeInt(0, sink);
} }
@ -635,6 +639,7 @@ static void opImport(Strings opFlags, Strings opArgs)
if (!opArgs.empty()) throw UsageError("no arguments expected"); if (!opArgs.empty()) throw UsageError("no arguments expected");
FdSource source(STDIN_FILENO); FdSource source(STDIN_FILENO);
while (readInt(source) == 1)
cout << format("%1%\n") % store->importPath(false, source); cout << format("%1%\n") % store->importPath(false, source);
} }