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

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