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

= changelog =
msg:           Fix package location if baseurl is present in the metadata
type:          bugfix
resolves:      https://github.com/rpm-software-management/dnf/issues/2130
This commit is contained in:
Marek Blaha 2024-09-18 09:46:20 +02:00 committed by amatej
parent 920688ae9f
commit 7b27428d3f
1 changed files with 2 additions and 0 deletions

View File

@ -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):