!40 add python2 and adpat python2
From: @zhuofeng6 Reviewed-by: @hubin95 Signed-off-by: @hubin95
This commit is contained in:
commit
1f1274a2ba
@ -51,9 +51,9 @@ index 9741567..3230539 100644
|
|||||||
+ continue
|
+ continue
|
||||||
+
|
+
|
||||||
+ if _space_re.search(key) is not None:
|
+ if _space_re.search(key) is not None:
|
||||||
+ raise ValueError(f"Spaces are not allowed in attributes: '{key}'")
|
+ raise ValueError("Spaces are not allowed in attributes: {}".format(key))
|
||||||
+
|
+
|
||||||
+ items.append(f'{escape(key)}="{escape(value)}"')
|
+ items.append('{}="{}"'.format(escape(key), escape(value)))
|
||||||
+
|
+
|
||||||
+ rv = " ".join(items)
|
+ rv = " ".join(items)
|
||||||
if autospace and rv:
|
if autospace and rv:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: python-jinja2
|
Name: python-jinja2
|
||||||
Version: 2.11.2
|
Version: 2.11.2
|
||||||
Release: 4
|
Release: 5
|
||||||
Summary: A full-featured template engine for Python
|
Summary: A full-featured template engine for Python
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://jinja.pocoo.org/
|
URL: http://jinja.pocoo.org/
|
||||||
@ -21,6 +21,19 @@ templating system but extends it with an expressive language that gives template
|
|||||||
a more powerful set of tools. On top of that it adds sandboxed execution and optional
|
a more powerful set of tools. On top of that it adds sandboxed execution and optional
|
||||||
automatic escaping for applications where security is important.
|
automatic escaping for applications where security is important.
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
|
%package -n python2-jinja2
|
||||||
|
Summary: General purpose template engine for python2
|
||||||
|
|
||||||
|
BuildRequires: python2-markupsafe python2-babel
|
||||||
|
BuildRequires: python2-pytest python2-devel python2-setuptools
|
||||||
|
Requires: python2-babel python2-markupsafe python2-setuptools
|
||||||
|
%{?python_provide:%python_provide python2-jinja2}
|
||||||
|
|
||||||
|
%description -n python2-jinja2
|
||||||
|
This package is the python2 version of python-jinja2.
|
||||||
|
%endif
|
||||||
|
|
||||||
%package -n python3-jinja2
|
%package -n python3-jinja2
|
||||||
Summary: General purpose template engine for python3
|
Summary: General purpose template engine for python3
|
||||||
|
|
||||||
@ -43,12 +56,27 @@ sed -i 's|\r$||g' Jinja2-%{version}/LICENSE.rst
|
|||||||
cp -a Jinja2-%{version} python3
|
cp -a Jinja2-%{version} python3
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if %{with python2}
|
||||||
|
pushd Jinja2-%{version}
|
||||||
|
%py2_build
|
||||||
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
pushd python3
|
pushd python3
|
||||||
%py3_build
|
%py3_build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if %{with python2}
|
||||||
|
pushd Jinja2-%{version}
|
||||||
|
%py2_install
|
||||||
|
|
||||||
|
#valid on python above 3.6, if not removed, installation will fail
|
||||||
|
rm %{buildroot}%{python2_sitelib}/jinja2/asyncsupport.py
|
||||||
|
rm %{buildroot}%{python2_sitelib}/jinja2/asyncfilters.py
|
||||||
|
|
||||||
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
pushd python3
|
pushd python3
|
||||||
%py3_install
|
%py3_install
|
||||||
@ -59,6 +87,13 @@ pushd python3
|
|||||||
PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests
|
PYTHONPATH=$(pwd)/src %{__python3} -m pytest tests
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
|
%files -n python2-jinja2
|
||||||
|
%license Jinja2-%{version}/LICENSE.rst
|
||||||
|
%{python2_sitelib}/jinja2
|
||||||
|
%{python2_sitelib}/Jinja2*-info
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n python3-jinja2
|
%files -n python3-jinja2
|
||||||
%license Jinja2-%{version}/LICENSE.rst
|
%license Jinja2-%{version}/LICENSE.rst
|
||||||
%{python3_sitelib}/jinja2
|
%{python3_sitelib}/jinja2
|
||||||
@ -69,6 +104,12 @@ popd
|
|||||||
%doc Jinja2-%{version}/ext Jinja2-%{version}/examples
|
%doc Jinja2-%{version}/ext Jinja2-%{version}/examples
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jan 25 2024 zhuofeng <zhuofeng2@huawei.com> - 2.11.2-5
|
||||||
|
Type:bugfix
|
||||||
|
CVE:NA
|
||||||
|
SUG:NA
|
||||||
|
DESC:add python2 and adpat python2
|
||||||
|
|
||||||
* Mon Jan 22 2024 weihaohao <weihaohao2@huawei.com> - 2.11.2-4
|
* Mon Jan 22 2024 weihaohao <weihaohao2@huawei.com> - 2.11.2-4
|
||||||
Type:CVE
|
Type:CVE
|
||||||
CVE:CVE-2024-22195
|
CVE:CVE-2024-22195
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user