Allow local downloads to same downloaddir
(cherry picked from commit 647da84a543db023286d58b7f3bbf1ace1dfad2f)
This commit is contained in:
parent
8b0122ae7c
commit
148736f1d4
30
backport-Allow-local-downloads-to-same-downloaddir.patch
Normal file
30
backport-Allow-local-downloads-to-same-downloaddir.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From dee3952a8c19d733b7c5b1d854b1ccde947d770d Mon Sep 17 00:00:00 2001
|
||||
From: Nic <138107617+nicbadiu@users.noreply.github.com>
|
||||
Date: Fri, 28 Jun 2024 12:56:34 +0300
|
||||
Subject: [PATCH] Allow local downloads to same `downloaddir`
|
||||
|
||||
Currently when `dnf download --downloaddir <dir> <package>` sources`<package>` from `<dir>` it triggers a `shutil.SameFileError` exception and aborts the entire download process.
|
||||
|
||||
This goes against the current flow which marks locally present RPMs that match a remote RPM as `[SKIPPED] <package>.rpm: Already downloaded`.
|
||||
|
||||
This change allows downloads of locally sourced packages to the same file, treating it as a no-op.
|
||||
---
|
||||
dnf/base.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dnf/base.py b/dnf/base.py
|
||||
index dac3cefd7a..c1affc8cba 100644
|
||||
--- a/dnf/base.py
|
||||
+++ b/dnf/base.py
|
||||
@@ -1320,7 +1320,10 @@ def download_packages(self, pkglist, progress=None, callback_total=None):
|
||||
pkg.location.lstrip("/"))
|
||||
else:
|
||||
location = os.path.join(pkg.repo.pkgdir, pkg.location.lstrip("/"))
|
||||
- shutil.copy(location, self.conf.destdir)
|
||||
+ try:
|
||||
+ shutil.copy(location, self.conf.destdir)
|
||||
+ except shutil.SameFileError:
|
||||
+ pass
|
||||
|
||||
def add_remote_rpms(self, path_list, strict=True, progress=None):
|
||||
# :api
|
||||
9
dnf.spec
9
dnf.spec
@ -3,7 +3,7 @@
|
||||
|
||||
Name: dnf
|
||||
Version: 4.14.0
|
||||
Release: 22
|
||||
Release: 23
|
||||
Summary: A software package manager that manages packages on Linux distributions.
|
||||
License: GPL-2.0-or-later AND GPL-1.0-only
|
||||
URL: https://github.com/rpm-software-management/dnf
|
||||
@ -33,6 +33,7 @@ Patch6013: backport-Add-all-candidates-for-reinstall-to-solver.patch
|
||||
Patch6014: backport-Limit-queries-to-nevra-forms-when-provided-by-command.patch
|
||||
Patch6015: backport-doc-Remove-provide-of-spec-definition-for-repoquery-command.patch
|
||||
Patch6016: backport-Update-the-man-page-entry-for-the-countme-option.patch
|
||||
Patch6017: backport-Allow-local-downloads-to-same-downloaddir.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: cmake gettext systemd bash-completion python3-sphinx
|
||||
@ -257,6 +258,12 @@ popd
|
||||
%{_mandir}/man8/%{name}-automatic.8*
|
||||
|
||||
%changelog
|
||||
* Sat Oct 19 2024 hanhuihui <hanhuihui5@huawei.com> - 4.14.0-23
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:Allow local downloads to same downloaddir
|
||||
|
||||
* Sun Sep 08 2024 Funda Wang <fundawang@yeah.net> - 4.14.0-22
|
||||
- Drop wrong obsolete tag
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user