aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 293becc68..9c4790039 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -623,9 +623,13 @@ static void opExport(Strings opFlags, Strings opArgs)
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(), 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");
FdSource source(STDIN_FILENO);
- cout << format("%1%\n") % store->importPath(false, source);
+ while (readInt(source) == 1)
+ cout << format("%1%\n") % store->importPath(false, source);
}