Blame SOURCES/0001-print-downloading-packages-only-once.patch

5c5e8c
From 15837579fef30f1e8fe1aa3017eb5441caf3f09c Mon Sep 17 00:00:00 2001
5c5e8c
From: Igor Gnatenko <ignatenko@redhat.com>
5c5e8c
Date: Fri, 17 Feb 2017 21:46:28 +0100
5c5e8c
Subject: [PATCH 1/2] print downloading packages only once
5c5e8c
5c5e8c
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
5c5e8c
---
5c5e8c
 dnf/dnf-main.c | 9 +++++++--
5c5e8c
 1 file changed, 7 insertions(+), 2 deletions(-)
5c5e8c
5c5e8c
diff --git a/dnf/dnf-main.c b/dnf/dnf-main.c
5c5e8c
index 610ad74..6473bb3 100644
5c5e8c
--- a/dnf/dnf-main.c
5c5e8c
+++ b/dnf/dnf-main.c
5c5e8c
@@ -29,6 +29,7 @@
5c5e8c
 static gboolean opt_yes = TRUE;
5c5e8c
 static gboolean opt_nodocs = FALSE;
5c5e8c
 static gboolean show_help = FALSE;
5c5e8c
+static gboolean dl_pkgs_printed = FALSE;
5c5e8c
 
5c5e8c
 static gboolean
5c5e8c
 process_global_option (const gchar  *option_name,
5c5e8c
@@ -115,8 +116,11 @@ state_action_changed_cb (DnfState       *state,
5c5e8c
         g_print("Downloading metadata...\n");
5c5e8c
         break;
5c5e8c
       case DNF_STATE_ACTION_DOWNLOAD_PACKAGES:
5c5e8c
-        g_print("Downloading: %s (%u%%)\n", action_hint,
5c5e8c
-                dnf_state_get_percentage (state));
5c5e8c
+        if (!dl_pkgs_printed)
5c5e8c
+          {
5c5e8c
+            g_print("Downloading packages...\n");
5c5e8c
+            dl_pkgs_printed = TRUE;
5c5e8c
+          }
5c5e8c
         break;
5c5e8c
       case DNF_STATE_ACTION_TEST_COMMIT:
5c5e8c
         g_print("Running transaction test...\n");
5c5e8c
@@ -141,6 +145,7 @@ state_action_changed_cb (DnfState       *state,
5c5e8c
         break;
5c5e8c
       case DNF_STATE_ACTION_CLEANUP:
5c5e8c
         g_print("Cleanup: %s\n", action_hint);
5c5e8c
+        break;
5c5e8c
       default:
5c5e8c
         break;
5c5e8c
     }
5c5e8c
-- 
5c5e8c
2.12.1
5c5e8c