Patch: Fix download errors handling in non-english locales (RhBug:2024527)

This commit is contained in:
Jaroslav Rohel 2022-03-30 09:48:06 +02:00
parent abfe6bcaaf
commit 07b4724b30
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From 3e36c99d401530dc026712523a7c445da17ee299 Mon Sep 17 00:00:00 2001
From: Marek Blaha <mblaha@redhat.com>
Date: Mon, 14 Mar 2022 09:49:52 +0100
Subject: [PATCH] Fix processing of download errors (RhBug: 2024527)
Users with different than english locale are not able to update their
systems in case that some of updates are already downloaded in the dnf
cache (e.g. using dnf-automatic).
The error string is taken from librepo target where it is stored
untranslated. Therefore we need to compare untranslated versions of the
string.
= changelog =
msg: Fix download errors handling in non-english locales
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2024527
---
dnf/repo.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/repo.py b/dnf/repo.py
index 1822cf0..ec1a253 100644
--- a/dnf/repo.py
+++ b/dnf/repo.py
@@ -108,7 +108,7 @@ def _download_payloads(payloads, drpm, fail_fast=True):
callbacks = tgt.getCallbacks()
payload = callbacks.package_pload
pkg = payload.pkg
- if err == _('Already downloaded'):
+ if err == 'Already downloaded':
errs._skipped.add(pkg)
continue
pkg.repo._repo.expire()
--
libgit2 1.1.0

View File

@ -66,12 +66,13 @@ It supports RPMs, modules and comps groups & environments.
Name: dnf Name: dnf
Version: 4.11.1 Version: 4.11.1
Release: 1%{?dist} Release: 2%{?dist}
Summary: %{pkg_summary} Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING # For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ License: GPLv2+
URL: https://github.com/rpm-software-management/dnf URL: https://github.com/rpm-software-management/dnf
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch0001: 0001-Fix-processing-of-download-errors-RhBug-2024527.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gettext BuildRequires: gettext
@ -359,6 +360,9 @@ popd
%{python3_sitelib}/%{name}/automatic/ %{python3_sitelib}/%{name}/automatic/
%changelog %changelog
* Wed Mar 30 2022 Jaroslav Rohel <jrohel@redhat.com> - 4.11.1-2
- Backport patch to fix: dnf breaks updateprocess with "already downloaded" (RhBug:2024527)
* Mon Mar 14 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 4.11.1-1 * Mon Mar 14 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 4.11.1-1
- Update to 4.11.1 - Update to 4.11.1