diff options
-rwxr-xr-x | bitbake/bin/toaster | 24 | ||||
-rw-r--r-- | bitbake/toaster-requirements.txt | 2 |
2 files changed, 11 insertions, 15 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 | ||
158 | verify_prereq() { | 158 | verify_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 |
266 | fi | 265 | fi |
267 | 266 | ||
268 | if ! verify_prereq; then | 267 | verify_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 | ||
271 | fi | ||
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 |
274 | if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then | 270 | if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then |
diff --git a/bitbake/toaster-requirements.txt b/bitbake/toaster-requirements.txt index 5d34494d54..0e8c742cb9 100644 --- a/bitbake/toaster-requirements.txt +++ b/bitbake/toaster-requirements.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | Django==1.8.6 | 1 | Django>1.8,<1.9 |
2 | argparse==1.2.1 | 2 | argparse==1.2.1 |
3 | wsgiref==0.1.2 | 3 | wsgiref==0.1.2 |
4 | beautifulsoup4>=4.4.0 | 4 | beautifulsoup4>=4.4.0 |