mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
nix copy: Revive progress bar
This commit is contained in:
parent
dffc3fe43b
commit
c5e4404580
6 changed files with 99 additions and 2 deletions
|
@ -56,6 +56,8 @@ static void dumpContents(const Path & path, size_t size,
|
|||
|
||||
static void dump(const Path & path, Sink & sink, PathFilter & filter)
|
||||
{
|
||||
checkInterrupt();
|
||||
|
||||
struct stat st;
|
||||
if (lstat(path.c_str(), &st))
|
||||
throw SysError(format("getting attributes of path '%1%'") % path);
|
||||
|
|
|
@ -80,4 +80,15 @@ std::atomic<uint64_t> nextId{(uint64_t) getpid() << 32};
|
|||
|
||||
Activity::Activity() : id(nextId++) { };
|
||||
|
||||
Activity::Activity(ActivityType type, std::string msg)
|
||||
: Activity()
|
||||
{
|
||||
logger->event(evStartActivity, id, msg);
|
||||
}
|
||||
|
||||
Activity::~Activity()
|
||||
{
|
||||
logger->event(evStopActivity, id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,6 +13,10 @@ typedef enum {
|
|||
lvlVomit
|
||||
} Verbosity;
|
||||
|
||||
typedef enum {
|
||||
actCopyPath = 100,
|
||||
} ActivityType;
|
||||
|
||||
class Activity
|
||||
{
|
||||
public:
|
||||
|
@ -21,6 +25,10 @@ public:
|
|||
Activity();
|
||||
Activity(const Activity & act) : id(act.id) { };
|
||||
Activity(uint64_t id) : id(id) { };
|
||||
Activity(ActivityType type, std::string msg = "");
|
||||
~Activity();
|
||||
|
||||
//void progress(...);
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
@ -35,6 +43,13 @@ typedef enum {
|
|||
evSubstitutionCreated = 8,
|
||||
evSubstitutionStarted = 9,
|
||||
evSubstitutionFinished = 10,
|
||||
|
||||
evCopyStarted = 100,
|
||||
evCopyProgress = 101,
|
||||
|
||||
evStartActivity = 1000,
|
||||
evStopActivity = 1001,
|
||||
|
||||
} EventType;
|
||||
|
||||
struct Event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue