From 9a40cbc99aed0046019a31945fdd44f52e834caa Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 6 Apr 2020 16:08:45 +0200 Subject: [PATCH] spec: require matching python3-osbuild version The `osbuild` executable requires that the exact same version of the corresponding python library is installed, but this was not enforced in the RPM package. Thus a old version of osbuild could be installed alongside an older version of python3-osbuild, which results in an osbuild crash (see below). Therefore, enforce that both installed packages have matching versions by specifying the exact version for the `python3-osbuild` dependency of the `osbuild` package. Example osbuild crash if versions are not matching: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master ws.require(__requires__) File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 791, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.VersionConflict: (osbuild 10 (/usr/lib/python3.8/site-packages), Requirement.parse('osbuild==11')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/bin/osbuild", line 6, in from pkg_resources import load_entry_point File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in def _initialize_master_working_set(): File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside f(*args, **kwargs) File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 585, in _build_master return cls._build_from_requirements(__requires__) File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'osbuild==11' distribution was not found and is required by the application --- osbuild.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osbuild.spec b/osbuild.spec index bb8a62b7..2b9c8f2c 100644 --- a/osbuild.spec +++ b/osbuild.spec @@ -33,7 +33,7 @@ Requires: systemd Requires: systemd-container Requires: tar Requires: util-linux -Requires: python3-%{pypi_name} +Requires: python3-%{pypi_name} = %{version}-%{release} # Turn off dependency generators for assemblers, runners and stages. # They run in a container, so there's no reason to generate dependencies