From 708899617424674ed37b3e58ff29d575d97d072f Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Tue, 11 Mar 2025 13:49:23 +0100 Subject: [PATCH] package: remote_location() takes basedir into account Resolves: RHEL-70875 --- ..._location-takes-basedir-into-account.patch | 36 +++++++++++++++++++ dnf.spec | 6 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0024-package-remote_location-takes-basedir-into-account.patch diff --git a/0024-package-remote_location-takes-basedir-into-account.patch b/0024-package-remote_location-takes-basedir-into-account.patch new file mode 100644 index 0000000..88f1c79 --- /dev/null +++ b/0024-package-remote_location-takes-basedir-into-account.patch @@ -0,0 +1,36 @@ +From 106bd18ddf28a4b4fdf13da8708e6aaa66eaeea8 Mon Sep 17 00:00:00 2001 +From: Marek Blaha +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 + diff --git a/dnf.spec b/dnf.spec index 98ca279..bbaea78 100644 --- a/dnf.spec +++ b/dnf.spec @@ -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 - 4.20.0-13 +- package: remote_location() takes basedir into account (RHEL-70875) + * Fri Feb 07 2025 Carl George - 4.20.0-12 - Override releasever_{major,minor} with system-release provides (RHEL-68034)