forked from lix-project/lix
* Export/import many paths in one go.
This commit is contained in:
parent
9da367b7d5
commit
0db450024d
|
@ -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,7 +639,8 @@ 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);
|
||||||
cout << format("%1%\n") % store->importPath(false, source);
|
while (readInt(source) == 1)
|
||||||
|
cout << format("%1%\n") % store->importPath(false, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue