Compare commits

...

No commits in common. "c8-stream-3.8" and "stream-python27-2.7-rhel-8.10.0" have entirely different histories.

7 changed files with 276 additions and 124 deletions

View File

@ -1 +1 @@
5605f75353368d32500afb30e60fc8f0edbca506 SOURCES/Babel-2.7.0.tar.gz
9adbd49864392713c6a3080aeb0a9e6432577277 Babel-2.5.1.tar.gz

6
.gitignore vendored
View File

@ -1 +1,5 @@
SOURCES/Babel-2.7.0.tar.gz
Babel-0.9.5.tar.gz
/Babel-0.9.6.tar.gz
/Babel-1.3.tar.gz
/Babel-2.3.4.tar.gz
/Babel-2.5.1.tar.gz

View File

@ -1,5 +1,5 @@
diff --git a/babel/localedata.py b/babel/localedata.py
index e012abb..dea0a0f 100644
index 4b6d3b6..080b723 100644
--- a/babel/localedata.py
+++ b/babel/localedata.py
@@ -13,6 +13,8 @@
@ -9,17 +9,17 @@ index e012abb..dea0a0f 100644
+import re
+import sys
import threading
from collections import MutableMapping
from itertools import chain
@@ -22,6 +24,7 @@ from babel._compat import pickle, string_types, abc
@@ -33,6 +35,7 @@ def get_base_dir():
_cache = {}
_cache_lock = threading.RLock()
_dirname = os.path.join(os.path.dirname(__file__), 'locale-data')
_dirname = os.path.join(get_base_dir(), 'locale-data')
+_windows_reserved_name_re = re.compile("^(con|prn|aux|nul|com[0-9]|lpt[0-9])$", re.I)
def normalize_locale(name):
@@ -38,6 +41,22 @@ def normalize_locale(name):
@@ -49,6 +52,22 @@ def normalize_locale(name):
return locale_id
@ -42,7 +42,7 @@ index e012abb..dea0a0f 100644
def exists(name):
"""Check whether locale data is available for the given locale.
@@ -49,7 +68,7 @@ def exists(name):
@@ -60,7 +79,7 @@ def exists(name):
return False
if name in _cache:
return True
@ -69,10 +69,10 @@ index e012abb..dea0a0f 100644
if name != 'root' and merge_inherited:
merge(data, pickle.load(fileobj))
diff --git a/tests/test_localedata.py b/tests/test_localedata.py
index dbacba0..4730096 100644
index 3599b21..173e7a3 100644
--- a/tests/test_localedata.py
+++ b/tests/test_localedata.py
@@ -11,11 +11,17 @@
@@ -11,12 +11,18 @@
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://babel.edgewall.org/log/.
@ -83,19 +83,19 @@ index dbacba0..4730096 100644
import unittest
import random
from operator import methodcaller
import sys
-from babel import localedata
-from babel import localedata, numbers
+import pytest
+
+from babel import localedata, Locale, UnknownLocaleError
+from babel import localedata, Locale, UnknownLocaleError, numbers
class MergeResolveTestCase(unittest.TestCase):
@@ -131,3 +137,34 @@ def test_locale_identifiers_cache(monkeypatch):
localedata.locale_identifiers.cache = None
assert localedata.locale_identifiers()
assert len(listdir_calls) == 2
+
@@ -117,3 +123,33 @@ def test_locale_argument_acceptance():
assert normalized_locale == None
locale_exist = localedata.exists(['en_us', None])
assert locale_exist == False
+
+def test_locale_name_cleanup():
+ """

View File

@ -0,0 +1,160 @@
From 5dfa1057b809f9bf848916a1001c742cf5229f46 Mon Sep 17 00:00:00 2001
From: Tomas Orsava <torsava@redhat.com>
Date: Mon, 18 Jun 2018 15:14:52 +0200
Subject: [PATCH] Skip tests involving freezegun module which we're not
shipping
---
tests/messages/test_frontend.py | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py
index 20904a3..236dd5c 100644
--- a/tests/messages/test_frontend.py
+++ b/tests/messages/test_frontend.py
@@ -11,7 +11,6 @@
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://babel.edgewall.org/log/.
import shlex
-from freezegun import freeze_time
from datetime import datetime
from distutils.dist import Distribution
from distutils.errors import DistutilsOptionError
@@ -150,7 +149,7 @@ class ExtractMessagesTestCase(unittest.TestCase):
self.cmd.output_file = self._pot_file()
self.assertRaises(DistutilsOptionError, self.cmd.finalize_options)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extraction_with_default_mapping(self):
self.cmd.copyright_holder = 'FooBar, Inc.'
self.cmd.msgid_bugs_address = 'bugs.address@email.tld'
@@ -208,7 +207,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extraction_with_mapping_file(self):
self.cmd.copyright_holder = 'FooBar, Inc.'
self.cmd.msgid_bugs_address = 'bugs.address@email.tld'
@@ -261,7 +260,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extraction_with_mapping_dict(self):
self.dist.message_extractors = {
'project': [
@@ -392,7 +391,7 @@ class InitCatalogTestCase(unittest.TestCase):
self.cmd.output_file = 'dummy'
self.assertRaises(DistutilsOptionError, self.cmd.finalize_options)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_with_output_dir(self):
self.cmd.input_file = 'project/i18n/messages.pot'
self.cmd.locale = 'en_US'
@@ -444,7 +443,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_keeps_catalog_non_fuzzy(self):
self.cmd.input_file = 'project/i18n/messages_non_fuzzy.pot'
self.cmd.locale = 'en_US'
@@ -496,7 +495,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_correct_init_more_than_2_plurals(self):
self.cmd.input_file = 'project/i18n/messages.pot'
self.cmd.locale = 'lv_LV'
@@ -550,7 +549,7 @@ msgstr[2] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_correct_init_singular_plural_forms(self):
self.cmd.input_file = 'project/i18n/messages.pot'
self.cmd.locale = 'ja_JP'
@@ -601,7 +600,7 @@ msgstr[0] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_supports_no_wrap(self):
self.cmd.input_file = 'project/i18n/long_messages.pot'
self.cmd.locale = 'en_US'
@@ -662,7 +661,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_supports_width(self):
self.cmd.input_file = 'project/i18n/long_messages.pot'
self.cmd.locale = 'en_US'
@@ -827,7 +826,7 @@ commands:
def assert_pot_file_exists(self):
assert os.path.isfile(self._pot_file())
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extract_with_default_mapping(self):
pot_file = self._pot_file()
self.cli.run(sys.argv + ['extract',
@@ -883,7 +882,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extract_with_mapping_file(self):
pot_file = self._pot_file()
self.cli.run(sys.argv + ['extract',
@@ -934,7 +933,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extract_with_exact_file(self):
"""Tests that we can call extract with a particular file and only
strings from that file get extracted. (Note the absence of strings from file1.py)
@@ -983,7 +982,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_init_with_output_dir(self):
po_file = self._po_file('en_US')
self.cli.run(sys.argv + ['init',
@@ -1034,7 +1033,7 @@ msgstr[1] ""
def _i18n_dir(self):
return os.path.join(self.datadir, 'project', 'i18n')
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_init_singular_plural_forms(self):
po_file = self._po_file('ja_JP')
self.cli.run(sys.argv + ['init',
@@ -1081,7 +1080,7 @@ msgstr[0] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_init_more_than_2_plural_forms(self):
po_file = self._po_file('lv_LV')
self.cli.run(sys.argv + ['init',
--
2.14.4

View File

@ -0,0 +1,15 @@
diff -up Babel-2.3.4/setup.py.orig Babel-2.3.4/setup.py
--- Babel-2.3.4/setup.py.orig 2016-04-11 11:58:25.000000000 +0200
+++ Babel-2.3.4/setup.py 2016-04-25 13:35:54.458765892 +0200
@@ -59,7 +59,10 @@ setup(
# This version identifier is currently necessary as
# pytz otherwise does not install on pip 1.4 or
# higher.
- 'pytz>=0a',
+ ### But the version confuses setuptools 8 and higher so remove it in the
+ ### system package
+ #'pytz>=0a',
+ 'pytz',
],
cmdclass={'import_cldr': import_cldr},

View File

@ -1,58 +1,63 @@
%global srcname Babel
%global sum Library for internationalizing Python applications
%bcond_without python3
%bcond_with python36_module
# There is some bootstrapping involved when upgrading Python 3
# First of all we need babel (this package) to use sphinx
# And pytest is at this point not yet ready
%bcond_without bootstrap
%bcond_with python2
%global bootstrap 0
Name: babel
Version: 2.7.0
Release: 11%{?dist}
Version: 2.5.1
Release: 10%{?dist}
Summary: Tools for internationalizing Python applications
License: BSD
URL: http://babel.pocoo.org/
Source0: https://files.pythonhosted.org/packages/source/B/%{srcname}/%{srcname}-%{version}.tar.gz
Patch0: babel-2.3.4-remove-pytz-version.patch
# Remove dependency on an exotic testing package python-freezegun which we
# don't have capacity to ship in RHEL8
Patch1: Skip-tests-involving-freezegun-module-which-we-re-no.patch
# Fix CVE-2021-20095: relative path traversal allows an attacker to load
# arbitrary locale files on disk and execute arbitrary code
# Resolved upstream: https://github.com/python-babel/babel/pull/782/
# CVE bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1955615
Patch1: CVE-2021-20095.patch
Patch2: CVE-2021-20095.patch
BuildArch: noarch
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%if %{with python2_pytest}
BuildRequires: python2-pytz
BuildRequires: python2-pytest
BuildRequires: python2-freezegun
%if %{with python3}
%if %{with python36_module}
BuildRequires: python36-devel
%else
BuildRequires: python3-devel
%endif
%endif
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-rpm-macros
%if !%{with bootstrap}
BuildRequires: python%{python3_pkgversion}-pytz
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-freezegun
BuildRequires: python3-setuptools
%if !%{bootstrap}
BuildRequires: python3-pytz
BuildRequires: python3-pytest
%endif
# build the documentation
BuildRequires: make
%if !%{bootstrap}
BuildRequires: python3-sphinx
%endif # bootstrap
%endif # python3
%if !%{with bootstrap}
BuildRequires: python%{python3_pkgversion}-sphinx
%endif
Requires: python2-babel
Requires: python2-setuptools
%description
@ -64,8 +69,6 @@ Babel is composed of two major parts:
providing access to various locale display names, localized number
and date formatting, etc.
%if %{with python2}
%package -n python2-babel
Summary: %sum
@ -82,18 +85,17 @@ Babel is composed of two major parts:
* a Python interface to the CLDR (Common Locale Data Repository),
providing access to various locale display names, localized number
and date formatting, etc.
%endif
%package -n python%{python3_pkgversion}-babel
%if %{with python3}
%package -n python3-babel
Summary: %sum
Requires: python%{python3_pkgversion}-setuptools
Requires: python%{python3_pkgversion}-pytz
Requires: python3-setuptools
Requires: python3-pytz
%{?python_provide:%python_provide python%{python3_pkgversion}-babel}
%{?python_provide:%python_provide python3-babel}
%description -n python%{python3_pkgversion}-babel
%description -n python3-babel
Babel is composed of two major parts:
* tools to build and work with gettext message catalogs
@ -102,7 +104,6 @@ Babel is composed of two major parts:
providing access to various locale display names, localized number
and date formatting, etc.
%if !%{with bootstrap}
%package doc
Summary: Documentation for Babel
Provides: python-babel-doc = %{version}-%{release}
@ -111,21 +112,22 @@ Provides: python3-babel-doc = %{version}-%{release}
%description doc
Documentation for Babel
%endif
%prep
%autosetup -n %{srcname}-%{version} -p1
%build
%if %{with python2}
%py2_build
%endif
%if %{with python3}
%py3_build
%endif
%if %{with python3}
%if !%{bootstrap}
BUILDDIR="$PWD/built-docs"
rm -rf "$BUILDDIR"
%if !%{with bootstrap}
pushd docs
make \
SPHINXBUILD=sphinx-build-3 \
@ -134,107 +136,77 @@ make \
popd
rm -f "$BUILDDIR/html/.buildinfo"
%endif
%endif
%install
%if %{with python2}
%py2_install
%endif
%if %{with python3}
%py3_install
%endif
%py2_install
mv %{buildroot}%{_bindir}/pybabel %{buildroot}%{_bindir}/pybabel-%{python3_version}
mv %{buildroot}%{_bindir}/pybabel{,-%{python2_version}}
ln -s pybabel-%{python2_version} %{buildroot}%{_bindir}/pybabel-2
%check
export TZ=America/New_York
%if %{with python2} && %{with python2_pytest}
%{__python2} -m pytest
%endif
%if !%{with bootstrap}
%if %{with python3}
%if !%{bootstrap}
%{__python3} -m pytest
%endif
%endif
%if %{with python2}
%files -n python2-babel
%files
%doc CHANGES AUTHORS
%license LICENSE
%{_bindir}/pybabel-2
%{_bindir}/pybabel-%{python2_version}
%files -n python2-babel
%{python2_sitelib}/Babel-%{version}-py*.egg-info
%{python2_sitelib}/babel
%endif
%files -n python%{python3_pkgversion}-babel
%doc CHANGES AUTHORS
%license LICENSE
%if %{with python3}
%files -n python3-babel
%{python3_sitelib}/Babel-%{version}-py*.egg-info
%{python3_sitelib}/babel
%{_bindir}/pybabel-%{python3_version}
%if !%{with bootstrap}
%if !%{bootstrap}
%files doc
%doc built-docs/html/*
%endif
%endif # bootstrap
%endif # python3
%changelog
* Wed May 12 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.7.0-11
* Wed May 12 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.5.1-10
- Fix CVE-2021-20095
Resolves: rhbz#1955615
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 2.7.0-10
- Exclude unsupported i686 arch
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 2.5.1-9
- Bumping due to problems with modular RPM upgrade path
- Resolves: rhbz#1695587
* Tue Dec 03 2019 Tomas Orsava <torsava@redhat.com> - 2.7.0-9
- Rename the pybabel executable to pybabel-3.8 and move it to the
python38-babel package
* Tue Oct 02 2018 Lumír Balhar <lbalhar@redhat.com> - 2.5.1-8
- Fix unversioned requires/buildrequires
- Resolves: rhbz#1628242
* Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 2.7.0-8
- Adjusted for Python 3.8 module in RHEL 8
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 2.5.1-7
- Remove unversioned binaries
- Resolves: rhbz#1613343
* Thu Oct 31 2019 Nils Philippsen <nils@tiptoe.de> - 2.7.0-7
- drop python2-babel only from F33 on as it is needed for trac (for the time
being, #1737930)
* Thu Oct 31 2019 Nils Philippsen <nils@tiptoe.de> - 2.7.0-6
- drop python2-babel from F32 on
* Fri Sep 13 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.0-5
- Reduce Python 2 build dependencies on Fedora 32
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.0-4
- Rebuilt for Python 3.8
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.0-3
- Bootstrap for Python 3.8
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon May 27 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 2.7.0-1
- update to upstream version 2.7.0
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 2.6.0-4
- Rebuilt for Python 3.7
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 2.6.0-3
- Rebuilt for Python 3.7
* Fri Jun 29 2018 Felix Schwarz <fschwarz@fedoraproject.org> - 2.6.0-2
- add setting to build without Python 2 support
* Fri Jun 29 2018 Felix Schwarz <fschwarz@fedoraproject.org> - 2.6.0-1
- update to upstream version 2.6.0
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 2.5.1-6
- Make possible to disable python3 subpackage
* Mon Jun 18 2018 Tomas Orsava <torsava@redhat.com> - 2.5.1-5
- Run tests in pytest (as declared in BuildRequires)
- Remove dependency on an exotic testing package python-freezegun which we
don't have capacity to ship in RHEL8
- Run tests in pytest (as declared in BuildRequires) instead of unittest
* Sat Jun 16 2018 Miro Hrončok <mhroncok@redhat.com> - 2.5.1-4
- Rebuilt for Python 3.7
* Mon Jun 18 2018 Tomas Orsava <torsava@redhat.com> - 2.5.1-4
- Build the documentation always using the Python 3 version Sphinx
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.5.1-3
- Bootstrap for Python 3.7
* Tue May 01 2018 Tomas Orsava <torsava@redhat.com> - 2.5.1-3
- Require the python36-devel package when building for the python36 module
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (Babel-2.5.1.tar.gz) = a2999bd75213bf2447079a210f774d49ae0d658476563ba5cdc4ddce8b58d4eb84bc70812d7e972923d1fa6283bc282b226a045db39ec65e2e95327d82271eb9