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

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