summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/toaster
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-12-09 19:56:43 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-14 23:13:08 +0000
commit4ff0d60ea851d74b74e3521d8a94be7e523b72c5 (patch)
tree224732df909db8825bf4a4ff56c00563e401e4e8 /bitbake/bin/toaster
parent4a784169437c94feb8a0e909515e9cf23236df8c (diff)
downloadpoky-4ff0d60ea851d74b74e3521d8a94be7e523b72c5.tar.gz
bitbake: toaster: rework checking of Django version
Checked django version considering information from toaster-requirements.txt, e.g. if requirements file contains line "Django>1.8,<1.9" toaster should be able to check that requirement correctly. (Bitbake rev: 49976eca4a6e37e7653814c569badcd3e0fb719a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/toaster')
-rwxr-xr-xbitbake/bin/toaster24
1 files changed, 10 insertions, 14 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 7645c56b15..1c1e029838 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -156,16 +156,15 @@ notify_chldexit() {
156 156
157 157
158verify_prereq() { 158verify_prereq() {
159 # Verify prerequisites 159 # Verify Django version
160 regex="([0-9])\.([0-9])" 160 reqfile=$(python -c "import os; print os.path.realpath('$BBBASEDIR/toaster-requirements.txt')")
161 for line in `cat $BBBASEDIR/toaster-requirements.txt | grep Django` ; do 161 exp='s/Django\([><=]\+\)\([^,]\+\),\([><=]\+\)\(.\+\)/'
162 [[ `echo $line` =~ $regex ]] 162 exp=$exp'import sys,django;version=django.get_version().split(".");'
163 required_major_version="${BASH_REMATCH[1]}" 163 exp=$exp'sys.exit(not (version \1 "\2".split(".") and version \3 "\4".split(".")))/p'
164 required_minor_version="${BASH_REMATCH[2]}" 164 if ! sed -n "$exp" $reqfile | python - ; then
165 done 165 req=`grep ^Django $reqfile`
166 166 echo "This program needs $req"
167 if ! echo "import django; print ($required_major_version,) == django.VERSION[0:1] and django.VERSION[1:2][0] in ($required_minor_version,)" | python 2>/dev/null | grep True >/dev/null; then 167 echo "Please install with pip install -r $reqfile"
168 printf "This program needs Django $required_major_version.$required_minor_version. Please install with\n\npip install -r $BBBASEDIR/toaster-requirements.txt\n"
169 return 2 168 return 2
170 fi 169 fi
171 170
@@ -265,10 +264,7 @@ if [ "$1" = 'restart-bitbake' ] ; then
265 return $rc 264 return $rc
266fi 265fi
267 266
268if ! verify_prereq; then 267verify_prereq || return 1
269 echo "Error: Could not verify that the needed dependencies are installed. Please use virtualenv and pip to install dependencies listed in toaster-requirements.txt" 1>&2
270 return 1
271fi
272 268
273# We make sure we're running in the current shell and in a good environment 269# We make sure we're running in the current shell and in a good environment
274if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then 270if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then