Merge "upgrade python-django to CentOS 7.6 version" into f/centos76

This commit is contained in:
Zuul 2019-01-04 07:19:58 +00:00 committed by Gerrit Code Review
commit 0c58aee440
10 changed files with 67 additions and 162 deletions

View File

@ -11,12 +11,12 @@ diff --git a/SPECS/python-django.spec b/SPECS/python-django.spec
index d0e54bb..5cf8579 100644 index d0e54bb..5cf8579 100644
--- a/SPECS/python-django.spec --- a/SPECS/python-django.spec
+++ b/SPECS/python-django.spec +++ b/SPECS/python-django.spec
@@ -29,7 +29,7 @@ @@ -22,7 +22,7 @@
Name: python-django Name: python-django
Version: 1.8.14 Version: 1.11.13
-Release: 1%{?dist} -Release: 4%{?dist}
+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver} +Release: 4.el7%{?_tis_dist}.%{tis_patch_ver}
Summary: A high-level Python Web framework Summary: A high-level Python Web framework
Group: Development/Languages Group: Development/Languages

View File

@ -2,4 +2,3 @@ spec-include-TiS-patches.patch
0001-Update-package-versioning-for-TIS-format.patch 0001-Update-package-versioning-for-TIS-format.patch
fix-build-failures-due-to-unwanted-sgid.patch fix-build-failures-due-to-unwanted-sgid.patch
meta-size-number-format.patch meta-size-number-format.patch
spec-patch-to-remove-SmartyPants.patch

View File

@ -12,8 +12,8 @@ diff --git a/SPECS/python-django.spec b/SPECS/python-django.spec
index 5cf8579..79557de 100644 index 5cf8579..79557de 100644
--- a/SPECS/python-django.spec --- a/SPECS/python-django.spec
+++ b/SPECS/python-django.spec +++ b/SPECS/python-django.spec
@@ -421,6 +421,8 @@ popd @@ -396,6 +396,8 @@ cd tests
%doc docs/_build/html/* # %doc docs/_build/html/*
%files bash-completion %files bash-completion
+%dir %attr(0755,root,root) %{_datadir}/bash-completion +%dir %attr(0755,root,root) %{_datadir}/bash-completion

View File

@ -3,30 +3,23 @@ From: Wei Zhou <wei.zhou@windriver.com>
Date: Wed, 11 Oct 2017 22:23:10 -0500 Date: Wed, 11 Oct 2017 22:23:10 -0500
Subject: [PATCH 1/1] meta size number format Subject: [PATCH 1/1] meta size number format
Signed-off-by: SidneyAn <ran1.an@intel.com>
--- ---
SPECS/python-django.spec | 2 ++ SPECS/python-django.spec | 1 +
1 file changed, 2 insertions(+) 1 file changed, 1 insertion(+)
diff --git a/SPECS/python-django.spec b/SPECS/python-django.spec diff --git a/SPECS/python-django.spec b/SPECS/python-django.spec
index 79557de..5bef0ec 100644 index 79557de..5bef0ec 100644
--- a/SPECS/python-django.spec --- a/SPECS/python-django.spec
+++ b/SPECS/python-django.spec +++ b/SPECS/python-django.spec
@@ -41,6 +41,7 @@ Patch0: python-django-1.8.3-shell-completion.patch @@ -32,6 +32,7 @@ Source0: https://files.pythonhosted.org/packages/source/D/Django/Django-%
# WRS # WRS
Patch1: session-filebase-backend-fix.patch Patch0: session-filebase-backend-fix.patch
+Patch2: size-number-format.patch +Patch1: size-number-format.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel
@@ -154,6 +155,7 @@ rm -rf Django.egg-info
# WRS
%patch1 -p1
+%patch2 -p1
# empty files
for f in \
-- --
1.8.3.1 1.8.3.1

View File

@ -3,34 +3,34 @@ From: Scott Little <scott.little@windriver.com>
Date: Fri, 26 Aug 2016 15:10:15 -0400 Date: Fri, 26 Aug 2016 15:10:15 -0400
Subject: [PATCH 1/1] WRS: spec-include-TiS-patches.patch Subject: [PATCH 1/1] WRS: spec-include-TiS-patches.patch
Signed-off-by: SidneyAn <ran1.an@intel.com>
--- ---
SPECS/python-django.spec | 6 ++++++ SPECS/python-django.spec | 5 ++++-
1 file changed, 6 insertions(+) 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/SPECS/python-django.spec b/SPECS/python-django.spec diff --git a/SPECS/python-django.spec b/SPECS/python-django.spec
index 269991d..d0e54bb 100644 index 269991d..d0e54bb 100644
--- a/SPECS/python-django.spec --- a/SPECS/python-django.spec
+++ b/SPECS/python-django.spec +++ b/SPECS/python-django.spec
@@ -39,6 +39,9 @@ Source0: https://files.pythonhosted.org/packages/source/D/Django/Django-% @@ -30,6 +30,9 @@ License: BSD
URL: http://www.djangoproject.com/
Patch0: python-django-1.8.3-shell-completion.patch Source0: https://files.pythonhosted.org/packages/source/D/Django/Django-%{version}.tar.gz
+# WRS +# WRS
+Patch1: session-filebase-backend-fix.patch +Patch0: session-filebase-backend-fix.patch
+ +
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel
@@ -149,6 +152,9 @@ rm -rf Django.egg-info
%patch0 @@ -146,7 +149,7 @@ principle.
%endif
+# WRS %prep
+%patch1 -p1 -%autosetup -n %{pkgname}-%{version}
+ +%autosetup -n %{pkgname}-%{version} -p1
# empty files
for f in \
django/contrib/staticfiles/models.py \ %build
-- --
1.9.1 1.8.3.1

View File

@ -1,20 +0,0 @@
diff --git a/SPECS/python-django.spec b/SPECS/python-django.spec
index 5bef0ec..827d08f 100644
--- a/SPECS/python-django.spec
+++ b/SPECS/python-django.spec
@@ -42,6 +42,7 @@ Patch0: python-django-1.8.3-shell-completion.patch
# WRS
Patch1: session-filebase-backend-fix.patch
Patch2: size-number-format.patch
+Patch3: remove-SmartyPantsHTMLTranslator.patch
BuildArch: noarch
BuildRequires: python2-devel
@@ -156,6 +157,7 @@ rm -rf Django.egg-info
# WRS
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# empty files
for f in \

View File

@ -1,50 +0,0 @@
From 3624581259cecf7ca2d695fbebc27fed2a4d941c Mon Sep 17 00:00:00 2001
From: root <root@yow-cgts4-lx.wrs.com>
Date: Thu, 5 Oct 2017 16:38:20 -0400
Subject: [PATCH] No smartypants
diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py
index fd93194..aa3afbb 100644
--- a/docs/_ext/djangodocs.py
+++ b/docs/_ext/djangodocs.py
@@ -12,7 +12,7 @@ from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.util.compat import Directive
from sphinx.util.console import bold
from sphinx.util.nodes import set_source_info
-from sphinx.writers.html import SmartyPantsHTMLTranslator
+from sphinx.writers.html import HTMLTranslator
# RE for option descriptions without a '--' prefix
simple_option_desc_re = re.compile(
@@ -227,7 +227,7 @@ class VersionDirective(Directive):
return ret
-class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
+class DjangoHTMLTranslator(HTMLTranslator):
"""
Django-specific reST to HTML tweaks.
"""
@@ -260,10 +260,10 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
#
def visit_literal_block(self, node):
self.no_smarty += 1
- SmartyPantsHTMLTranslator.visit_literal_block(self, node)
+ HTMLTranslator.visit_literal_block(self, node)
def depart_literal_block(self, node):
- SmartyPantsHTMLTranslator.depart_literal_block(self, node)
+ HTMLTranslator.depart_literal_block(self, node)
self.no_smarty -= 1
#
@@ -300,7 +300,7 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
old_ids = node.get('ids', [])
node['ids'] = ['s-' + i for i in old_ids]
node['ids'].extend(old_ids)
- SmartyPantsHTMLTranslator.visit_section(self, node)
+ HTMLTranslator.visit_section(self, node)
node['ids'] = old_ids

View File

@ -2,24 +2,26 @@ diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.
index cd2457d..dc10ea3 100644 index cd2457d..dc10ea3 100644
--- a/django/template/defaultfilters.py --- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py
@@ -905,15 +905,15 @@ def filesizeformat(bytes): @@ -896,15 +896,15 @@ def filesizeformat(bytes_):
if bytes < KB: if bytes_ < KB:
value = ungettext("%(size)d byte", "%(size)d bytes", bytes) % {'size': bytes} value = ungettext("%(size)d byte", "%(size)d bytes", bytes_) % {'size': bytes_}
elif bytes < MB: elif bytes_ < MB:
- value = ugettext("%s KB") % filesize_number_format(bytes / KB) - value = ugettext("%s KB") % filesize_number_format(bytes_ / KB)
+ value = ugettext("%s KiB") % filesize_number_format(bytes / KB) + value = ugettext("%s KiB") % filesize_number_format(bytes_ / KB)
elif bytes < GB: elif bytes_ < GB:
- value = ugettext("%s MB") % filesize_number_format(bytes / MB) - value = ugettext("%s MB") % filesize_number_format(bytes_ / MB)
+ value = ugettext("%s MiB") % filesize_number_format(bytes / MB) + value = ugettext("%s MiB") % filesize_number_format(bytes_ / MB)
elif bytes < TB: elif bytes_ < TB:
- value = ugettext("%s GB") % filesize_number_format(bytes / GB) - value = ugettext("%s GB") % filesize_number_format(bytes_ / GB)
+ value = ugettext("%s GiB") % filesize_number_format(bytes / GB) + value = ugettext("%s GiB") % filesize_number_format(bytes_ / GB)
elif bytes < PB: elif bytes_ < PB:
- value = ugettext("%s TB") % filesize_number_format(bytes / TB) - value = ugettext("%s TB") % filesize_number_format(bytes_ / TB)
+ value = ugettext("%s TiB") % filesize_number_format(bytes / TB) + value = ugettext("%s TiB") % filesize_number_format(bytes_ / TB)
else: else:
- value = ugettext("%s PB") % filesize_number_format(bytes / PB) - value = ugettext("%s PB") % filesize_number_format(bytes_ / PB)
+ value = ugettext("%s PiB") % filesize_number_format(bytes / PB) + value = ugettext("%s PiB") % filesize_number_format(bytes_ / PB)
if negative:
value = "-%s" % value
return avoid_wrapping(value)

View File

@ -1 +1 @@
mirror:Source/python-django-1.8.14-1.el7.src.rpm mirror:Source/python-django-1.11.13-4.el7.src.rpm

View File

@ -4,52 +4,33 @@ Date: Mon, 11 Jul 2016 16:20:13 -0400
Subject: [PATCH 1/1] session-filebase-backend-fix Subject: [PATCH 1/1] session-filebase-backend-fix
--- ---
Django-1.8.7 | 1 + Django-1.11.13 | 1 +
django/contrib/sessions/backends/file.py | 15 ++++++++++++--- django/contrib/sessions/backends/file.py | 3 +++
2 files changed, 13 insertions(+), 3 deletions(-) 2 files changed, 4 insertions(+)
create mode 120000 Django-1.8.7 create mode 100644 Django-1.11.13
diff --git a/Django-1.8.7 b/Django-1.8.7 diff --git a/Django-1.11.13 b/Django-1.11.13
new file mode 120000 new file mode 100644
index 0000000..2fa6e7c index 0000000..b7c239f
--- /dev/null --- /dev/null
+++ b/Django-1.8.7 +++ b/Django-1.11.13
@@ -0,0 +1 @@ @@ -0,0 +1 @@
+Django-1.8.7 +Django-1.11.13
\ No newline at end of file
diff --git a/django/contrib/sessions/backends/file.py b/django/contrib/sessions/backends/file.py diff --git a/django/contrib/sessions/backends/file.py b/django/contrib/sessions/backends/file.py
index 41469c4..2b10b3e 100644 index 41469c4..2b10b3e 100644
--- a/django/contrib/sessions/backends/file.py --- a/django/contrib/sessions/backends/file.py
+++ b/django/contrib/sessions/backends/file.py +++ b/django/contrib/sessions/backends/file.py
@@ -71,6 +71,17 @@ class SessionStore(SessionBase): @@ -78,6 +78,9 @@ class SessionStore(SessionBase):
modification = datetime.datetime.fromtimestamp(modification) expiry = session_data.get('_session_expiry')
return modification if not expiry:
expiry = self._last_modification() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE)
+ def _expiry_date(self, session_data):
+ """
+ Return the expiry time of the file storing the session's content.
+ """
+ expiry = session_data.get('_session_expiry')
+ if not expiry:
+ expiry = self._last_modification() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE)
+ elif not isinstance(expiry, datetime.datetime): + elif not isinstance(expiry, datetime.datetime):
+ expiry = self._last_modification() + datetime.timedelta(seconds=expiry) + expiry = self._last_modification() + datetime.timedelta(seconds=expiry)
+ return expiry
+ +
return expiry
def load(self): def load(self):
session_data = {}
try:
@@ -89,9 +100,7 @@ class SessionStore(SessionBase):
self.create()
# Remove expired sessions.
- expiry_age = self.get_expiry_age(
- modification=self._last_modification(),
- expiry=session_data.get('_session_expiry'))
+ expiry_age = self.get_expiry_age(expiry=self._expiry_date(session_data))
if expiry_age < 0:
session_data = {}
self.delete()
-- --
1.9.1 1.8.3.1