feat(flatpak): report the download flatpak never announces
Installing a .flatpakref looked frozen: flatpak prints two lines and then stays silent for the minutes a runtime takes to come down, so the window repeated the same sentence over a stalled bar and the journal recorded nothing at all. It has no meter to print — measured here, on a real 658 MB install, it draws nothing on a pipe nor on a full terminal, only on the deltas the CDN happens to serve — so the provider now measures the transfer itself: the bytes landing in flatpak's own staging directory, reported as they grow. When even those stop, the window takes over and says which step is running and for how long, in the status bar and in the journal. Along the way the runner reads with read() instead of stdio so in-place updates are not held back by a buffer, strips the ANSI escapes some tools colour their output with (the AUR plugin's own copy is gone), and turns a rewritten meter line into a journal entry every 10 %.
This commit is contained in:
11 files changed
+529
-63
No files matched your search
@@ -40,20 +40,6 @@ static std::string lastOutputLines(const std::string& output, int maxLines = 4)
|
||||
return out;
|
||||
}
|
||||
|
||||
// Strip ANSI color escapes (`yay -Ss` colors repo/name pairs).
|
||||
static std::string stripAnsi(const std::string& s) {
|
||||
std::string out;
|
||||
for (size_t i = 0; i < s.size(); ++i) {
|
||||
if (s[i] == '\033' && i + 1 < s.size() && s[i + 1] == '[') {
|
||||
i += 2;
|
||||
while (i < s.size() && s[i] != 'm') ++i;
|
||||
continue;
|
||||
}
|
||||
out += s[i];
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
std::string AurManager::helper() {
|
||||
// yay first (most common), paru as fallback.
|
||||
if (system("command -v yay > /dev/null 2>&1") == 0) return "yay";
|
||||
|
||||
Reference in new issue
Block a user