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

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