diff options
author | David Reyna <David.Reyna@windriver.com> | 2017-06-27 13:44:28 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 16:02:15 +0100 |
commit | d74bcbeaf241a67871d62b7e2c17900ae900642e (patch) | |
tree | bd0bf6037a0de26e7668f146ec6ff4afde07e54f /bitbake/bin | |
parent | c3058ec4a4f2f4c57116816a5bede1e61a5a4cc4 (diff) | |
download | poky-d74bcbeaf241a67871d62b7e2c17900ae900642e.tar.gz |
bitbake: toaster: address Django-1.10 API deprecations
There are four main API deprecations in Django-1.10:
(a) String view arguments to url() must be replaced by
the explicit class reference
(b) New TEMPLATES stucture in settings.py consolidates
TEMPLATE_DIRS, TEMPLATE_CONTEXT_PROCESSORS,
TEMPLATE_LOADERS, TEMPLATE_STRING_IF_INVALID, and
TEMPLATE_DEBUG
(c) patterns() wrapper in url() is removed, with
urlpatterns now a simple list
(d) NoArgsCommand in commands() must be replace by
BaseCommand, and handle_noargs() changed to
handle()
Also, the Django version checker must be updated to accept
two digit sub-version numbers (e.g. "1.8" < "1.10")
[YOCTO #11684]
(Bitbake rev: e4c7a94fac7a53fc146387a57e5a09b9ec3caca0)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/toaster | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index 61a4a0f85d..c2e33fe376 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster | |||
@@ -116,8 +116,14 @@ verify_prereq() { | |||
116 | # Verify Django version | 116 | # Verify Django version |
117 | reqfile=$(python3 -c "import os; print(os.path.realpath('$BBBASEDIR/toaster-requirements.txt'))") | 117 | reqfile=$(python3 -c "import os; print(os.path.realpath('$BBBASEDIR/toaster-requirements.txt'))") |
118 | exp='s/Django\([><=]\+\)\([^,]\+\),\([><=]\+\)\(.\+\)/' | 118 | exp='s/Django\([><=]\+\)\([^,]\+\),\([><=]\+\)\(.\+\)/' |
119 | exp=$exp'import sys,django;version=django.get_version().split(".");' | 119 | # expand version parts to 2 digits to support 1.10.x > 1.8 |
120 | exp=$exp'sys.exit(not (version \1 "\2".split(".") and version \3 "\4".split(".")))/p' | 120 | # (note:helper functions hard to insert in-line) |
121 | exp=$exp'import sys,django;' | ||
122 | exp=$exp'version=["%02d" % int(n) for n in django.get_version().split(".")];' | ||
123 | exp=$exp'vmin=["%02d" % int(n) for n in "\2".split(".")];' | ||
124 | exp=$exp'vmax=["%02d" % int(n) for n in "\4".split(".")];' | ||
125 | exp=$exp'sys.exit(not (version \1 vmin and version \3 vmax))' | ||
126 | exp=$exp'/p' | ||
121 | if ! sed -n "$exp" $reqfile | python3 - ; then | 127 | if ! sed -n "$exp" $reqfile | python3 - ; then |
122 | req=`grep ^Django $reqfile` | 128 | req=`grep ^Django $reqfile` |
123 | echo "This program needs $req" | 129 | echo "This program needs $req" |