Canonicalize Python versions and properly handle != spec
Fixes https://github.com/rpm-software-management/rpm/issues/639 From upstream PR: https://github.com/rpm-software-management/rpm/pull/757
This commit is contained in:
parent
70b3ebc993
commit
ff085a044d
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Name: python-rpm-generators
|
Name: python-rpm-generators
|
||||||
Summary: Dependency generators for Python RPMs
|
Summary: Dependency generators for Python RPMs
|
||||||
Version: 8
|
Version: 9
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
|
|
||||||
# Originally all those files were part of RPM, so license is kept here
|
# Originally all those files were part of RPM, so license is kept here
|
||||||
@ -49,6 +49,9 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} pythondeps.sh pythondistdeps.py
|
|||||||
%{_rpmconfigdir}/pythondistdeps.py
|
%{_rpmconfigdir}/pythondistdeps.py
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 24 2019 Tomas Orsava <torsava@redhat.com> - 9-1
|
||||||
|
- Canonicalize Python versions and properly handle != spec
|
||||||
|
|
||||||
* Wed Apr 17 2019 Miro Hrončok <mhroncok@redhat.com> - 8-1
|
* Wed Apr 17 2019 Miro Hrončok <mhroncok@redhat.com> - 8-1
|
||||||
- console_scripts entry points to require setuptools
|
- console_scripts entry points to require setuptools
|
||||||
https://github.com/rpm-software-management/rpm/pull/666
|
https://github.com/rpm-software-management/rpm/pull/666
|
||||||
|
@ -151,7 +151,10 @@ for f in files:
|
|||||||
if legacy_name not in py_deps:
|
if legacy_name not in py_deps:
|
||||||
py_deps[legacy_name] = []
|
py_deps[legacy_name] = []
|
||||||
if dist.version:
|
if dist.version:
|
||||||
spec = ('==', dist.version)
|
version = dist.version
|
||||||
|
while version.endswith('.0'):
|
||||||
|
version = version[:-2]
|
||||||
|
spec = ('==', version)
|
||||||
if spec not in py_deps[name]:
|
if spec not in py_deps[name]:
|
||||||
if not legacy:
|
if not legacy:
|
||||||
py_deps[name].append(spec)
|
py_deps[name].append(spec)
|
||||||
@ -195,11 +198,12 @@ for f in files:
|
|||||||
else:
|
else:
|
||||||
name = 'python{}dist({})'.format(dist.py_version, dep.key)
|
name = 'python{}dist({})'.format(dist.py_version, dep.key)
|
||||||
for spec in dep.specs:
|
for spec in dep.specs:
|
||||||
if spec[0] != '!=':
|
while spec[1].endswith('.0'):
|
||||||
if name not in py_deps:
|
spec = (spec[0], spec[1][:-2])
|
||||||
py_deps[name] = []
|
if name not in py_deps:
|
||||||
if spec not in py_deps[name]:
|
py_deps[name] = []
|
||||||
py_deps[name].append(spec)
|
if spec not in py_deps[name]:
|
||||||
|
py_deps[name].append(spec)
|
||||||
if not dep.specs:
|
if not dep.specs:
|
||||||
py_deps[name] = []
|
py_deps[name] = []
|
||||||
# Unused, for automatic sub-package generation based on 'extras' from egg/dist metadata
|
# Unused, for automatic sub-package generation based on 'extras' from egg/dist metadata
|
||||||
@ -245,7 +249,10 @@ for name in names:
|
|||||||
if py_deps[name]:
|
if py_deps[name]:
|
||||||
# Print out versioned provides, requires, recommends, conflicts
|
# Print out versioned provides, requires, recommends, conflicts
|
||||||
for spec in py_deps[name]:
|
for spec in py_deps[name]:
|
||||||
print('{} {} {}'.format(name, spec[0], spec[1]))
|
if spec[0] == '!=':
|
||||||
|
print('({n} < {v} or {n} >= {v}.0)'.format(n=name, v=spec[1]))
|
||||||
|
else:
|
||||||
|
print('{} {} {}'.format(name, spec[0], spec[1]))
|
||||||
else:
|
else:
|
||||||
# Print out unversioned provides, requires, recommends, conflicts
|
# Print out unversioned provides, requires, recommends, conflicts
|
||||||
print(name)
|
print(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user