From 2b98ccb626ca7b026138cd5dc7cee7507e3b904c Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Mar 15 2022 12:54:47 +0000 Subject: [PATCH 1/2] Update spec file according to fedora. Signed-off-by: Jan Kaluza --- diff --git a/rpmdeplint.spec b/rpmdeplint.spec index 1dd49dc..95f92eb 100644 --- a/rpmdeplint.spec +++ b/rpmdeplint.spec @@ -1,14 +1,6 @@ %global upstream_version 1.4 -# Note that EPEL7 *does* have a Python 3 stack, but we are still missing -# Python 3 bindings for RPM so we don't build any Python 3 support on EPEL7. -%if 0%{?fedora} || 0%{?rhel} >= 8 -%bcond_without python3 -%else -%bcond_with python3 -%endif - Name: rpmdeplint Version: 1.4 Release: 1%{?dist} @@ -20,140 +12,63 @@ BuildArch: noarch # The base package is just the CLI, which pulls in the rpmdeplint # Python modules to do the real work. -%if %{with python3} Requires: python3-%{name} = %{version}-%{release} -%else -Requires: python2-%{name} = %{version}-%{release} -%endif %description -Rpmdeplint is a tool to find errors in RPM packages in the context of their -dependency graph. - -%package -n python2-%{name} -%{?python_provide:%python_provide python2-%{name}} -Summary: %{summary} -BuildRequires: python2-devel -%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 -BuildRequires: python2-sphinx -BuildRequires: python2-pytest -BuildRequires: python2-rpmfluff -BuildRequires: python2-six -BuildRequires: python2-rpm -BuildRequires: python2-solv -BuildRequires: python2-librepo -BuildRequires: python2-requests -BuildRequires: python2-scandir -Requires: python2-six -Requires: python2-rpm -Requires: python2-solv -Requires: python2-librepo -Requires: python2-requests -Requires: python2-scandir -%else -BuildRequires: python-sphinx -BuildRequires: pytest -%if 0%{?fedora} -BuildRequires: python2-rpmfluff -%else -BuildRequires: python-rpmfluff -%endif -BuildRequires: python-six -BuildRequires: rpm-python -BuildRequires: python2-solv -BuildRequires: python-librepo -BuildRequires: python-requests -BuildRequires: python-scandir -Requires: python-six -Requires: rpm-python -Requires: python2-solv -Requires: python-librepo -Requires: python-requests -Requires: python-scandir -%endif - -%description -n python2-%{name} -Rpmdeplint is a tool to find errors in RPM packages in the context of their +Rpmdeplint is a tool to find errors in RPM packages in the context of their dependency graph. -This package provides a Python 2 API for performing the checks. -%if %{with python3} %package -n python3-%{name} %{?python_provide:%python_provide python3-%{name}} Summary: %{summary} BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: python3-sphinx BuildRequires: python3-pytest -BuildRequires: python3-rpmfluff BuildRequires: python3-six -%if 0%{?fedora} >= 25 || 0%{?rhel} >= 8 BuildRequires: python3-rpm -%else -BuildRequires: rpm-python3 -%endif -BuildRequires: python3-solv +BuildRequires: python3-hawkey BuildRequires: python3-librepo -BuildRequires: python3-requests +BuildRequires: python3-solv +BuildRequires: python3-rpmfluff Requires: python3-six -%if 0%{?fedora} >= 25 || 0%{?rhel} >= 8 Requires: python3-rpm -%else -Requires: rpm-python3 -%endif -Requires: python3-solv +Requires: python3-hawkey Requires: python3-librepo -Requires: python3-requests +Requires: python3-solv +Requires: python3-rpmfluff %description -n python3-%{name} -Rpmdeplint is a tool to find errors in RPM packages in the context of their +Rpmdeplint is a tool to find errors in RPM packages in the context of their dependency graph. This package provides a Python 3 API for performing the checks. -%endif %prep %setup -q -n %{name}-%{upstream_version} + + rm -rf rpmdeplint.egg-info %build -%py2_build -%if %{with python3} %py3_build -%endif %install -%py2_install -%if %{with python3} %py3_install -%endif %check -%if 0%{?rhel} == 7 -alias py.test-2="py.test-2.7" -%endif -py.test-2 rpmdeplint -%if %{with python3} -py.test-3 rpmdeplint -%endif +py.test-3 rpmdeplint -k "not TestDependencyAnalyzer" # Acceptance tests do not work in mock because they require .i686 packages. %files %{_bindir}/%{name} %{_mandir}/man1/%{name}.1.* -%files -n python2-%{name} -%license COPYING -%doc README.rst -%{python2_sitelib}/%{name}/ -%{python2_sitelib}/%{name}*.egg-info - -%if %{with python3} %files -n python3-%{name} %license COPYING %doc README.rst %{python3_sitelib}/%{name}/ %{python3_sitelib}/%{name}*.egg-info -%endif %changelog From b8abfa52a30b1064ce23c37ed2528b3c198f7e1a Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Mar 16 2022 08:26:04 +0000 Subject: [PATCH 2/2] Do not check for conflicts between the same packages. Signed-off-by: Jan Kaluza --- diff --git a/rpmdeplint/__init__.py b/rpmdeplint/__init__.py index 2e7172f..0a66c69 100644 --- a/rpmdeplint/__init__.py +++ b/rpmdeplint/__init__.py @@ -388,7 +388,10 @@ class DependencyAnalyzer(object): # Hence this approach, where we visit each solvable and use Python # set operations to look for any overlapping filenames. for conflicting in self.pool.solvables: - if conflicting == solvable: + # Conflicts cannot happen between identical solvables and also + # between solvables with the same name - such solvables cannot + # be installed next to each other. + if conflicting == solvable or conflicting.name == solvable.name: continue conflict_filenames = filenames.intersection(self._files_in_solvable(conflicting)) if not conflict_filenames: