Compare commits

...

No commits in common. "c8s" and "c8-stream-3.8" have entirely different histories.

10 changed files with 126 additions and 173 deletions

1
.babel.metadata Normal file
View File

@ -0,0 +1 @@
5605f75353368d32500afb30e60fc8f0edbca506 SOURCES/Babel-2.7.0.tar.gz

6
.gitignore vendored
View File

@ -1,5 +1 @@
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
SOURCES/Babel-2.7.0.tar.gz

View File

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

View File

@ -1,29 +1,21 @@
%global srcname Babel
%global sum Library for internationalizing Python applications
# On fedora 24 and beyond we want to use the python3 version by default
# (Only reason earlier versions aren't switched is that we didn't push it out
# before the release)
%if 0%{?fedora} >= 24 || 0%{?rhel} > 7
%global default_python 3
%else
%global default_python 2
%endif
# 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
%global bootstrap 0
%bcond_without bootstrap
%bcond_with python2
Name: babel
Version: 2.5.1
Release: 7%{?dist}
Version: 2.7.0
Release: 11%{?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
# Fix CVE-2021-20095: relative path traversal allows an attacker to load
# arbitrary locale files on disk and execute arbitrary code
@ -32,35 +24,34 @@ Patch0: babel-2.3.4-remove-pytz-version.patch
Patch1: 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 0%{?rhel} && 0%{?rhel} <= 7
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%if %{with python2_pytest}
BuildRequires: python2-pytz
BuildRequires: python2-pytest
BuildRequires: python2-freezegun
%endif
BuildRequires: python3-devel
BuildRequires: platform-python-setuptools
%if !%{bootstrap}
BuildRequires: python3-pytz
BuildRequires: python3-pytest
%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
%endif
# build the documentation
BuildRequires: make
%if %{default_python} >= 3
%if %{bootstrap}
BuildRequires: python2-sphinx
%else
BuildRequires: python3-sphinx
%endif
Requires: python3-babel
Requires: platform-python-setuptools
%else
BuildRequires: python2-sphinx
Requires: python2-babel
Requires: python2-setuptools
%if !%{with bootstrap}
BuildRequires: python%{python3_pkgversion}-sphinx
%endif
@ -73,11 +64,13 @@ 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
Requires: python2-setuptools
Requires: pytz
Requires: python2-pytz
%{?python_provide:%python_provide python2-babel}
@ -89,16 +82,18 @@ 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 python3-babel
%package -n python%{python3_pkgversion}-babel
Summary: %sum
Requires: platform-python-setuptools
Requires: python3-pytz
Requires: python%{python3_pkgversion}-setuptools
Requires: python%{python3_pkgversion}-pytz
%{?python_provide:%python_provide python3-babel}
%{?python_provide:%python_provide python%{python3_pkgversion}-babel}
%description -n python3-babel
%description -n python%{python3_pkgversion}-babel
Babel is composed of two major parts:
* tools to build and work with gettext message catalogs
@ -107,6 +102,7 @@ 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}
@ -115,90 +111,130 @@ Provides: python3-babel-doc = %{version}-%{release}
%description doc
Documentation for Babel
%endif
%prep
%autosetup -n %{srcname}-%{version} -p1
%build
%if 0%{?rhel} && 0%{?rhel} <= 7
%if %{with python2}
%py2_build
%endif
%py3_build
BUILDDIR="$PWD/built-docs"
rm -rf "$BUILDDIR"
%if !%{with bootstrap}
pushd docs
make \
%if %{default_python} >= 3 && !%{bootstrap}
SPHINXBUILD=sphinx-build-3 \
%else
SPHINXBUILD=sphinx-build \
%endif
BUILDDIR="$BUILDDIR" \
html
popd
rm -f "$BUILDDIR/html/.buildinfo"
%endif
%install
%if %{default_python} >= 3
%if 0%{?rhel} && 0%{?rhel} <= 7
%if %{with python2}
%py2_install
%endif
%py3_install
%else
%py3_install
%py2_install
%endif
mv %{buildroot}%{_bindir}/pybabel %{buildroot}%{_bindir}/pybabel-%{python3_version}
%check
# test_frontend needs python-freezegun
rm tests/messages/test_frontend.py
export TZ=America/New_York
%if 0%{?rhel} && 0%{?rhel} <= 7
%if %{with python2} && %{with python2_pytest}
%{__python2} -m pytest
%endif
%if !%{bootstrap}
%if !%{with bootstrap}
%{__python3} -m pytest
%endif
%files
%if %{with python2}
%files -n python2-babel
%doc CHANGES AUTHORS
%license LICENSE
%if 0%{?rhel} && 0%{?rhel} <= 7
%files -n python2-babel
%{python2_sitelib}/Babel-%{version}-py*.egg-info
%{python2_sitelib}/babel
%endif
%files -n python3-babel
%{_bindir}/pybabel
%files -n python%{python3_pkgversion}-babel
%doc CHANGES AUTHORS
%license LICENSE
%{python3_sitelib}/Babel-%{version}-py*.egg-info
%{python3_sitelib}/babel
%{_bindir}/pybabel-%{python3_version}
%if !%{with bootstrap}
%files doc
%doc built-docs/html/*
%endif
%changelog
* Thu Jul 15 2021 Tomas Orsava <torsava@redhat.com> - 2.5.1-7
- Include the /usr/bin/pybabel binary that runs on Python 3.6 in the
python3-babel package
Resolves: rhbz#1967173
* Fri May 07 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.5.1-6
* Wed May 12 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.7.0-11
- Fix CVE-2021-20095
Resolves: rhbz#1955615
* Thu Mar 28 2019 Nils Philippsen <nils@redhat.com> - 2.5.1-5
- make spec file work without %%rhel being defined
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 2.7.0-10
- Exclude unsupported i686 arch
* Tue Mar 26 2019 Nils Philippsen <nils@redhat.com> - 2.5.1-4
- depend on platform-python-setuptools rather than python3-setuptools (#1650487)
* 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
* Mon Jun 18 2018 Petr Viktorin <pviktori@redhat.com> - 2.5.1-3
- Remove the freezegun dependency
* Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 2.7.0-8
- Adjusted for Python 3.8 module in RHEL 8
* 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
* Mon Jun 18 2018 Tomas Orsava <torsava@redhat.com> - 2.5.1-5
- Run tests in pytest (as declared in BuildRequires)
* Sat Jun 16 2018 Miro Hrončok <mhroncok@redhat.com> - 2.5.1-4
- Rebuilt for Python 3.7
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.5.1-3
- Bootstrap for Python 3.7
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View File

@ -1,15 +0,0 @@
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,6 +0,0 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

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

View File

@ -1,8 +0,0 @@
#!/bin/bash
# smoke tests for the babel runtime
# bail out on any error
set -e
pybabel --list-locales

View File

@ -1,27 +0,0 @@
#!/bin/bash
# Run Babel's unit tests with the installed packages.
# bail out if anything goes wrong
set -e
# run in its own subdirectory without the whole sources underneath
mkdir testrun
# first, copy over unit tests and make them find the installed modules and
# files as if they were an exploded source tarball
cp -r source/tests testrun/
# test_frontend needs python3-freezegun
rm testrun/tests/messages/test_frontend.py
BABELDIR="$(python3 -c 'import os.path; import babel; print(os.path.dirname(babel.__file__))')"
ln -snf "$BABELDIR" testrun/babel
pushd testrun
# run the tests
export TZ=America/New_York
pytest-3
popd # testrun

View File

@ -1,23 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-source
tags:
- always
- role: standard-test-basic
tags:
- atomic
- classic
required_packages:
- babel
- coreutils
- python3-babel
- python3-pytest
tests:
- smoke:
dir: .
run: ./run-smoke-tests.sh
- verify:
dir: .
run: ./run-unit-tests-on-installed-pkg.sh