aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPuck Meerburg <puck@puckipedia.com>2024-05-18 20:13:48 +0000
committerGerrit Code Review <gerrit@lix-systems>2024-05-18 20:13:48 +0000
commit62b1adf8c1f53798a6879352094ce5f1da11e7d7 (patch)
treeb0b73abc237fd371fbe529746ebda1342652f70f /src
parentd7d1547a41f2a0520e3f7599a7da8732e3775deb (diff)
parent1fe58bd8a747f9c6d5b27c521fbf3d7b281e130d (diff)
Merge "nix cat/dump-path/key: stop progress bar before writeFull" into main
Diffstat (limited to 'src')
-rw-r--r--src/nix/cat.cc6
-rw-r--r--src/nix/dump-path.cc3
-rw-r--r--src/nix/sigs.cc3
3 files changed, 11 insertions, 1 deletions
diff --git a/src/nix/cat.cc b/src/nix/cat.cc
index 60aa66ce0..678edd9a1 100644
--- a/src/nix/cat.cc
+++ b/src/nix/cat.cc
@@ -2,6 +2,7 @@
#include "store-api.hh"
#include "fs-accessor.hh"
#include "nar-accessor.hh"
+#include "progress-bar.hh"
using namespace nix;
@@ -17,7 +18,10 @@ struct MixCat : virtual Args
if (st.type != FSAccessor::Type::tRegular)
throw Error("path '%1%' is not a regular file", path);
- writeFull(STDOUT_FILENO, accessor->readFile(path));
+ auto file = accessor->readFile(path);
+
+ stopProgressBar();
+ writeFull(STDOUT_FILENO, file);
}
};
diff --git a/src/nix/dump-path.cc b/src/nix/dump-path.cc
index c4edc894b..fb32dddb7 100644
--- a/src/nix/dump-path.cc
+++ b/src/nix/dump-path.cc
@@ -1,6 +1,7 @@
#include "command.hh"
#include "store-api.hh"
#include "archive.hh"
+#include "progress-bar.hh"
using namespace nix;
@@ -20,6 +21,7 @@ struct CmdDumpPath : StorePathCommand
void run(ref<Store> store, const StorePath & storePath) override
{
+ stopProgressBar();
FdSink sink(STDOUT_FILENO);
store->narFromPath(storePath, sink);
sink.flush();
@@ -55,6 +57,7 @@ struct CmdDumpPath2 : Command
void run() override
{
+ stopProgressBar();
FdSink sink(STDOUT_FILENO);
dumpPath(path, sink);
sink.flush();
diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc
index 730aa6532..eeb14e29a 100644
--- a/src/nix/sigs.cc
+++ b/src/nix/sigs.cc
@@ -3,6 +3,7 @@
#include "store-api.hh"
#include "thread-pool.hh"
#include "signals.hh"
+#include "progress-bar.hh"
#include <atomic>
@@ -220,6 +221,8 @@ struct CmdKey : NixMultiCommand
{
if (!command)
throw UsageError("'nix key' requires a sub-command.");
+
+ stopProgressBar();
command->second->run();
}
};