#47 [WIP] Fix a regression with required legacy versions (e.g. pytz>dev)
Closed a year ago by churchyard. Opened a year ago by churchyard.
rpms/ churchyard/python-rpm-generators legacyversion-fix-regression  into  rawhide

file modified
+5 -1
@@ -1,7 +1,7 @@ 

  Name:           python-rpm-generators

  Summary:        Dependency generators for Python RPMs

  Version:        12

- Release:        10%{?dist}

+ Release:        11%{?dist}

  

  # Originally all those files were part of RPM, so license is kept here

  License:        GPLv2+
@@ -47,6 +47,10 @@ 

  %{_rpmconfigdir}/pythonbundles.py

  

  %changelog

+ * Thu Nov 04 2021 Miro Hrončok <mhroncok@redhat.com> - 12-11

+ - Fix a regression with required legacy versions (e.g. pytz>dev)

+ - Fixes rhbz#2019954

+ 

  * Fri Oct 29 2021 Gordon Messmer <gordon.messmer@gmail.com> - 12-10

  - Additional fix for dev releases.

  

file modified
+9 -5
@@ -236,11 +236,15 @@ 

      else:

          version = RpmVersion(version_id)

      # Prevent dev and pre-releases from satisfying a < requirement

-     if operator == '<' and not version.pre and not version.dev and not version.post:

-         version = '{}~~'.format(version)

-     # Prevent post-releases from satisfying a > requirement

-     if operator == '>' and not version.pre and not version.dev and not version.post:

-         version = '{}.0'.format(version)

+     try:

+         # For backwards compatibility, fallback to previous behavior with LegacyVersions

+         if operator == '<' and not version.pre and not version.dev and not version.post:

+             version = '{}~~'.format(version)

+         # Prevent post-releases from satisfying a > requirement

+         if operator == '>' and not version.pre and not version.dev and not version.post:

+             version = '{}.0'.format(version)

+     except AttributeError:

+         pass

      return '{} {} {}'.format(name, operator, version)

  

  

@@ -102,3 +102,5 @@ 

  test_underscores==1

  

  dnspython[DNSSEC]

+ 

+ legacy>dev

@@ -1312,6 +1312,7 @@ 

                  (python3.9dist(hugo3) < 11.1.1~b14 or python3.9dist(hugo3) > 11.1.1~b14)

                  python3.9dist(hugo4) > 11~rc0

                  python3.9dist(hugo5) = 11.1^post3

+                 python3.9dist(legacy) > dev

                  python3.9dist(pyparsing0)

                  ((python3.9dist(pyparsing1) < 2.0.4 or python3.9dist(pyparsing1) > 2.0.4) with (python3.9dist(pyparsing1) < 2.1.2 or python3.9dist(pyparsing1) > 2.1.2) with (python3.9dist(pyparsing1) < 2.1.6 or python3.9dist(pyparsing1) > 2.1.6) with python3.9dist(pyparsing1) >= 2.0.1)

                  python3.9dist(test-multiple-underscores) = 1

Build succeeded.

rebased onto 13ab465

a year ago

Build succeeded.

Pull-Request has been closed by churchyard

a year ago