Blame SOURCES/0005-Allow-downgrade-for-all-transactions-microdnf-does-RhBug1725863.patch

5b2e17
From a22e544907364467c9206fc196a9e43b684465a2 Mon Sep 17 00:00:00 2001
5b2e17
From: Aleš Matěj <amatej@redhat.com>
5b2e17
Date: Tue, 27 Aug 2019 10:54:14 +0200
5b2e17
Subject: [PATCH] Allow downgrade for all transactions microdnf does (RhBug:1725863)
5b2e17
5b2e17
It can sometimes be necessary to satisfy dependencies or if the user
5b2e17
wants to specifically downgrade some package.
5b2e17
---
5b2e17
 dnf/dnf-main.c | 10 +++++++---
5b2e17
 1 file changed, 7 insertions(+), 3 deletions(-)
5b2e17
5b2e17
diff --git a/dnf/dnf-main.c b/dnf/dnf-main.c
5b2e17
index 7c71bd0..693ad7f 100644
5b2e17
--- a/dnf/dnf-main.c
5b2e17
+++ b/dnf/dnf-main.c
5b2e17
@@ -272,12 +272,16 @@ main (int   argc,
5b2e17
             goto out;
5b2e17
         }
5b2e17
 
5b2e17
+      /* allow downgrades for all transaction types */
5b2e17
+      DnfTransaction *txn = dnf_context_get_transaction (ctx);
5b2e17
+      int flags = dnf_transaction_get_flags (txn) | DNF_TRANSACTION_FLAG_ALLOW_DOWNGRADE;
5b2e17
+
5b2e17
       if (opt_nodocs)
5b2e17
         {
5b2e17
-          DnfTransaction *txn = dnf_context_get_transaction (ctx);
5b2e17
-          dnf_transaction_set_flags (txn,
5b2e17
-                                     dnf_transaction_get_flags (txn) | DNF_TRANSACTION_FLAG_NODOCS);
5b2e17
+          flags |= DNF_TRANSACTION_FLAG_NODOCS;
5b2e17
         }
5b2e17
+
5b2e17
+      dnf_transaction_set_flags (txn, flags);
5b2e17
     }
5b2e17
 
5b2e17
   /*
5b2e17
--
5b2e17
libgit2 0.28.2
5b2e17