Blame SOURCES/0010-Add-fail_fast-parameter-to-download_payloads-methods.patch

29510e
From ca3d7f06c8f4c1c901dc853ac33c06976b46c61e Mon Sep 17 00:00:00 2001
29510e
From: Marek Blaha <mblaha@redhat.com>
29510e
Date: Wed, 6 Oct 2021 09:56:05 +0200
29510e
Subject: [PATCH] Add fail_fast parameter to download_payloads methods
29510e
29510e
Unlike in the rpm transaction, reposync needs to switch the fail_fast
29510e
off to download as much packages from repository as possible.
29510e
---
29510e
 dnf/base.py | 6 +++---
29510e
 dnf/repo.py | 4 ++--
29510e
 2 files changed, 5 insertions(+), 5 deletions(-)
29510e
29510e
diff --git a/dnf/base.py b/dnf/base.py
bc72d2
index b0a378c2..c258a5a7 100644
29510e
--- a/dnf/base.py
29510e
+++ b/dnf/base.py
29510e
@@ -1151,7 +1151,7 @@ class Base(object):
29510e
         timer()
29510e
         self._trans_success = True
29510e
 
29510e
-    def _download_remote_payloads(self, payloads, drpm, progress, callback_total):
29510e
+    def _download_remote_payloads(self, payloads, drpm, progress, callback_total, fail_fast=True):
29510e
         lock = dnf.lock.build_download_lock(self.conf.cachedir, self.conf.exit_on_lock)
29510e
         with lock:
29510e
             beg_download = time.time()
29510e
@@ -1163,7 +1163,7 @@ class Base(object):
29510e
                 progress.start(len(payloads), est_remote_size, total_drpms=total_drpm)
29510e
             else:
29510e
                 progress.start(len(payloads), est_remote_size)
29510e
-            errors = dnf.repo._download_payloads(payloads, drpm)
29510e
+            errors = dnf.repo._download_payloads(payloads, drpm, fail_fast)
29510e
 
29510e
             if errors._irrecoverable():
29510e
                 raise dnf.exceptions.DownloadError(errors._irrecoverable())
29510e
@@ -1189,7 +1189,7 @@ class Base(object):
29510e
                 est_remote_size = sum(pload.download_size
29510e
                                       for pload in payloads)
29510e
                 progress.start(len(payloads), est_remote_size)
29510e
-                errors = dnf.repo._download_payloads(payloads, drpm)
29510e
+                errors = dnf.repo._download_payloads(payloads, drpm, fail_fast)
29510e
 
29510e
                 if errors._irrecoverable():
29510e
                     raise dnf.exceptions.DownloadError(errors._irrecoverable())
29510e
diff --git a/dnf/repo.py b/dnf/repo.py
bc72d2
index b454e981..bb422309 100644
29510e
--- a/dnf/repo.py
29510e
+++ b/dnf/repo.py
bc72d2
@@ -84,7 +84,7 @@ def _pkg2payload(pkg, progress, *factories):
29510e
     raise ValueError(_('no matching payload factory for %s') % pkg)
29510e
 
29510e
 
29510e
-def _download_payloads(payloads, drpm):
29510e
+def _download_payloads(payloads, drpm, fail_fast=True):
29510e
     # download packages
29510e
     def _download_sort_key(payload):
29510e
         return not hasattr(payload, 'delta')
bc72d2
@@ -94,7 +94,7 @@ def _download_payloads(payloads, drpm):
29510e
                for pload in sorted(payloads, key=_download_sort_key)]
29510e
     errs = _DownloadErrors()
29510e
     try:
29510e
-        libdnf.repo.PackageTarget.downloadPackages(libdnf.repo.VectorPPackageTarget(targets), True)
29510e
+        libdnf.repo.PackageTarget.downloadPackages(libdnf.repo.VectorPPackageTarget(targets), fail_fast)
29510e
     except RuntimeError as e:
29510e
         errs._fatal = str(e)
29510e
     drpm.wait()
bc72d2
-- 
bc72d2
2.35.1
29510e