package: remote_location() takes basedir into account

Resolves: RHEL-70875
This commit is contained in:
Marek Blaha 2025-03-11 13:49:23 +01:00
parent 4f0c53e254
commit 7088996174
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 106bd18ddf28a4b4fdf13da8708e6aaa66eaeea8 Mon Sep 17 00:00:00 2001
From: Marek Blaha <mblaha@redhat.com>
Date: Wed, 18 Sep 2024 09:46:20 +0200
Subject: [PATCH] package: remote_location() takes basedir into account
If the package location in the repodata contains basedir, it needs to be
taken into account when calculating the package's remote_location.
Resolves: https://github.com/rpm-software-management/dnf/issues/2130
Upstream commit: 7b27428d
= changelog =
msg: Fix package location if baseurl is present in the metadata
type: bugfix
resolves: https://github.com/rpm-software-management/dnf/issues/2130
---
dnf/package.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dnf/package.py b/dnf/package.py
index fc89cf98..5912f79c 100644
--- a/dnf/package.py
+++ b/dnf/package.py
@@ -300,6 +300,8 @@ class Package(hawkey.Package):
"""
if self._from_system or self._from_cmdline:
return None
+ if self.baseurl:
+ return os.path.join(self.baseurl, self.location.lstrip("/"))
return self.repo.remote_location(self.location, schemes)
def _is_local_pkg(self):
--
2.48.1

View File

@ -72,7 +72,7 @@ It supports RPMs, modules and comps groups & environments.
Name: dnf
Version: 4.20.0
Release: 12%{?dist}
Release: 13%{?dist}
Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPL-2.0-or-later AND GPL-1.0-only
@ -101,6 +101,7 @@ Patch20: 0020-Add-releasever-major-and-releasever-minor-options.patch
Patch21: 0021-doc-Document-detect_releasevers-and-update-example.patch
Patch22: 0022-tests-Patch-detect_releasevers-not-detect_releasever.patch
Patch23: 0023-Document-how-releasever-releasever_-major-minor-affe.patch
Patch24: 0024-package-remote_location-takes-basedir-into-account.patch
BuildArch: noarch
BuildRequires: cmake
@ -456,6 +457,9 @@ popd
# bootc subpackage does not include any files
%changelog
* Tue Mar 11 2025 Marek Blaha <mblaha@redhat.com> - 4.20.0-13
- package: remote_location() takes basedir into account (RHEL-70875)
* Fri Feb 07 2025 Carl George <carl@redhat.com> - 4.20.0-12
- Override releasever_{major,minor} with system-release provides (RHEL-68034)