Blob Blame History Raw
From 15837579fef30f1e8fe1aa3017eb5441caf3f09c Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 17 Feb 2017 21:46:28 +0100
Subject: [PATCH 1/2] print downloading packages only once

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
 dnf/dnf-main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dnf/dnf-main.c b/dnf/dnf-main.c
index 610ad74..6473bb3 100644
--- a/dnf/dnf-main.c
+++ b/dnf/dnf-main.c
@@ -29,6 +29,7 @@
 static gboolean opt_yes = TRUE;
 static gboolean opt_nodocs = FALSE;
 static gboolean show_help = FALSE;
+static gboolean dl_pkgs_printed = FALSE;
 
 static gboolean
 process_global_option (const gchar  *option_name,
@@ -115,8 +116,11 @@ state_action_changed_cb (DnfState       *state,
         g_print("Downloading metadata...\n");
         break;
       case DNF_STATE_ACTION_DOWNLOAD_PACKAGES:
-        g_print("Downloading: %s (%u%%)\n", action_hint,
-                dnf_state_get_percentage (state));
+        if (!dl_pkgs_printed)
+          {
+            g_print("Downloading packages...\n");
+            dl_pkgs_printed = TRUE;
+          }
         break;
       case DNF_STATE_ACTION_TEST_COMMIT:
         g_print("Running transaction test...\n");
@@ -141,6 +145,7 @@ state_action_changed_cb (DnfState       *state,
         break;
       case DNF_STATE_ACTION_CLEANUP:
         g_print("Cleanup: %s\n", action_hint);
+        break;
       default:
         break;
     }
-- 
2.12.1