From 1009d9c40134fac8ebbee82b9cfb2ce93980440c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Aug 30 2019 12:11:42 +0000 Subject: switch to Python 3 for F32+ (#1737928) Resolves: rhbz#1737928 --- diff --git a/subversion-1.12.2-py3tests.patch b/subversion-1.12.2-py3tests.patch new file mode 100644 index 0000000..e526141 --- /dev/null +++ b/subversion-1.12.2-py3tests.patch @@ -0,0 +1,44 @@ + +Fix tests for Python 3. + +--- subversion-1.12.2/subversion/tests/cmdline/svnadmin_tests.py.py3tests ++++ subversion-1.12.2/subversion/tests/cmdline/svnadmin_tests.py +@@ -3859,7 +3859,7 @@ + sbox.repo_url) + + dump_lines = svntest.actions.run_and_verify_dump(sbox.repo_dir) +- assert propval + '\n' in dump_lines ++ assert bytes(propval, 'utf-8') + b'\n' in dump_lines + + def check_recover_prunes_rep_cache(sbox, enable_rep_sharing): + """Check 'recover' prunes the rep-cache while enable-rep-sharing is +--- subversion-1.12.2/subversion/tests/cmdline/svntest/verify.py.py3tests ++++ subversion-1.12.2/subversion/tests/cmdline/svntest/verify.py +@@ -135,11 +135,17 @@ + actual = [actual] + + if self.match_all: ++ if len(expected) and len(actual) \ ++ and type(actual[0]) is bytes and type(expected[0]) is str: ++ actual = [a.decode('utf-8') for a in actual] + return expected == actual + + i_expected = 0 + for actual_line in actual: +- if expected[i_expected] == actual_line: ++ expected_line = expected[i_expected] ++ if type(actual_line) is bytes and type(expected_line) is str: ++ actual_line == actual_line.decode('utf-8') ++ if expected_line == actual_line: + i_expected += 1 + if i_expected == len(expected): + return True +@@ -475,6 +481,8 @@ + if actual is not None: + logger.warn('ACTUAL %s:', actual_label) + for x in actual: ++ if type(x) == bytes: ++ x = x.decode("utf-8") + logger.warn('| ' + x.rstrip()) + + def compare_and_display_lines(message, label, expected, actual, diff --git a/subversion.spec b/subversion.spec index a066729..7933add 100644 --- a/subversion.spec +++ b/subversion.spec @@ -1,11 +1,19 @@ # set to zero to avoid running test suite %bcond_without kwallet -%bcond_without python2 -%bcond_with python3 %bcond_without bdb %bcond_without tests + +# Python 2 for F<32, Python 3 for F>=32 +%if 0%{?fedora} < 32 +%bcond_without python2 +%bcond_with python3 %bcond_without pyswig +%else +%bcond_with python2 +%bcond_without python3 +%bcond_with pyswig +%endif %ifarch %{power64} s390x %global with_java 0 @@ -37,7 +45,7 @@ Summary: A Modern Concurrent Version Control System Name: subversion Version: 1.12.2 -Release: 1%{?dist} +Release: 2%{?dist} License: ASL 2.0 URL: https://subversion.apache.org/ @@ -50,6 +58,7 @@ Source6: svnserve.service Source7: svnserve.tmpfiles Source8: svnserve.sysconf Patch1: subversion-1.12.0-linking.patch +Patch2: subversion-1.12.2-py3tests.patch Patch4: subversion-1.8.0-rubybind.patch Patch5: subversion-1.8.5-swigplWall.patch BuildRequires: autoconf, libtool, texinfo, which @@ -204,6 +213,9 @@ This package includes supplementary tools for use with Subversion. %prep %setup -q %patch1 -p1 -b .linking +%if %{with python3} +%patch2 -p1 -b .py3tests +%endif %patch4 -p1 -b .rubybind %patch5 -p1 -b .swigplWall @@ -520,6 +532,9 @@ make check-javahl %endif %changelog +* Fri Aug 30 2019 Joe Orton - 1.12.2-2 +- switch to Python 3 for F32+ (#1737928) + * Thu Jul 25 2019 Joe Orton - 1.12.2-1 - update to 1.12.2