summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2016-09-29 11:59:58 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2016-10-20 11:23:49 +0000
commitd1078f579eeba3bc9faf4e49c9e4c5da2f9d1085 (patch)
tree0f9bdee48ad533a28407c2e17d91d5df82adcc13
parentf956591bbe246fae0dc4ed9b6d911bcec526463f (diff)
downloadmeta-boot2qt-d1078f579eeba3bc9faf4e49c9e4c5da2f9d1085.tar.gz
ostree: Print pull progress also when not on console
Change-Id: I3944166b61d120f19e31f84abcf26e91a2f8cfb8 Upstream-status: Pending Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
-rw-r--r--recipes/ostree/ostree.bb1
-rw-r--r--recipes/ostree/ostree/Print-pull-progress-also-when-not-on-console.patch94
2 files changed, 95 insertions, 0 deletions
diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb
index 75d5bd5..37af99d 100644
--- a/recipes/ostree/ostree.bb
+++ b/recipes/ostree/ostree.bb
@@ -43,6 +43,7 @@ SRC_URI = " \
43 file://Allow-updating-files-in-the-boot-directory.patch \ 43 file://Allow-updating-files-in-the-boot-directory.patch \
44 file://u-boot-add-bootdir-to-the-generated-uEnv.txt.patch \ 44 file://u-boot-add-bootdir-to-the-generated-uEnv.txt.patch \
45 file://Create-firmware-convenience-symlinks.patch \ 45 file://Create-firmware-convenience-symlinks.patch \
46 file://Print-pull-progress-also-when-not-on-console.patch \
46 " 47 "
47 48
48SRCREV = "8ece4d6d51bdbe3e41ab318259276bb83e553aa0" 49SRCREV = "8ece4d6d51bdbe3e41ab318259276bb83e553aa0"
diff --git a/recipes/ostree/ostree/Print-pull-progress-also-when-not-on-console.patch b/recipes/ostree/ostree/Print-pull-progress-also-when-not-on-console.patch
new file mode 100644
index 0000000..f8e7324
--- /dev/null
+++ b/recipes/ostree/ostree/Print-pull-progress-also-when-not-on-console.patch
@@ -0,0 +1,94 @@
1From b24d691d968bca608142882b453e98ed5ee267e9 Mon Sep 17 00:00:00 2001
2From: Gatis Paeglis <gatis.paeglis@qt.io>
3Date: Thu, 29 Sep 2016 11:46:59 +0200
4Subject: [PATCH] Print pull progress also when not on console
5
6glnx_console_text is smart enough:
7
8"On a tty, print to the console @text followed by an ASCII art
9 progress bar whose percentage is @percentage. If stdout is not a
10 tty, a more basic line by line change will be printed."
11
12Otherwise, when pulling a lot of data, we do not get any feedback
13in a GUI application for a significant amount of time.
14---
15 src/ostree/ot-admin-builtin-switch.c | 3 +--
16 src/ostree/ot-admin-builtin-upgrade.c | 3 +--
17 src/ostree/ot-builtin-pull-local.c | 3 +--
18 src/ostree/ot-builtin-pull.c | 12 ++++--------
19 4 files changed, 7 insertions(+), 14 deletions(-)
20
21diff --git a/src/ostree/ot-admin-builtin-switch.c b/src/ostree/ot-admin-builtin-switch.c
22index 895538a..7f1d6dd 100644
23--- a/src/ostree/ot-admin-builtin-switch.c
24+++ b/src/ostree/ot-admin-builtin-switch.c
25@@ -126,8 +126,7 @@ ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GErro
26 { g_auto(GLnxConsoleRef) console = { 0, };
27 glnx_console_lock (&console);
28
29- if (console.is_tty)
30- progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
31+ progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
32
33 /* Always allow older...there's not going to be a chronological
34 * relationship necessarily.
35diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c
36index 81f9bb6..8147b4f 100644
37--- a/src/ostree/ot-admin-builtin-upgrade.c
38+++ b/src/ostree/ot-admin-builtin-upgrade.c
39@@ -109,8 +109,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GErr
40 { g_auto(GLnxConsoleRef) console = { 0, };
41 glnx_console_lock (&console);
42
43- if (console.is_tty)
44- progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
45+ progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
46
47 if (opt_allow_downgrade)
48 upgraderpullflags |= OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER;
49diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c
50index 5401a28..f2f5b21 100644
51--- a/src/ostree/ot-builtin-pull-local.c
52+++ b/src/ostree/ot-builtin-pull-local.c
53@@ -159,8 +159,7 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
54 g_variant_builder_add (&builder, "{s@v}", "depth",
55 g_variant_new_variant (g_variant_new_int32 (opt_depth)));
56
57- if (console.is_tty)
58- progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
59+ progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
60
61 opts = g_variant_ref_sink (g_variant_builder_end (&builder));
62 if (!ostree_repo_pull_with_options (repo, src_repo_uri,
63diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c
64index 99b2593..78686b3 100644
65--- a/src/ostree/ot-builtin-pull.c
66+++ b/src/ostree/ot-builtin-pull.c
67@@ -242,20 +242,16 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError **
68
69 if (!opt_dry_run)
70 {
71- if (console.is_tty)
72- progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
73+ progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
74 }
75 else
76 {
77 progress = ostree_async_progress_new_and_connect (dry_run_console_progress_changed, NULL);
78 }
79
80- if (console.is_tty)
81- {
82- signal_handler_id = g_signal_connect (repo, "gpg-verify-result",
83- G_CALLBACK (gpg_verify_result_cb),
84- &console);
85- }
86+ signal_handler_id = g_signal_connect (repo, "gpg-verify-result",
87+ G_CALLBACK (gpg_verify_result_cb),
88+ &console);
89
90 if (!ostree_repo_pull_with_options (repo, remote, g_variant_builder_end (&builder),
91 progress, cancellable, error))
92--
932.7.4
94