Skip to content

Commit

Permalink
Preserve epel-release package
Browse files Browse the repository at this point in the history
  • Loading branch information
to-bar committed Jun 7, 2022
1 parent db85df3 commit 0fd848a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ def _install_base_packages(self):
releasever = '8' if self._tools.dnf_config_manager.get_variable('releasever') == '8.4' else None
self._tools.dnf.update(package='libmodulemd', releasever=releasever)

# epel-release package is re-installed if repo it provides is not enabled
# epel-release package is re-installed when repo it provides is not enabled
epel_package_initially_present: bool = self._tools.rpm.is_package_installed('epel-release')

if (
self._tools.rpm.is_package_installed('epel-release') and
epel_package_initially_present and
(not self._tools.dnf.is_repo_enabled('epel')
or not self._tools.dnf.is_repo_enabled('epel-modular'))
):
Expand All @@ -70,7 +72,9 @@ def _install_base_packages(self):
# some packages are from EPEL repo, ensure the latest version
if not self._tools.rpm.is_package_installed('epel-release'):
self._tools.dnf.install('https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm')
self.__installed_packages.append('epel-release')

if not epel_package_initially_present:
self.__installed_packages.append('epel-release')
else:
self._tools.dnf.update('https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm')

Expand Down

0 comments on commit 0fd848a

Please sign in to comment.