]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: Check Django version against toaster-requirements.txt
authorElliot Smith <elliot.smith@intel.com>
Thu, 10 Dec 2015 03:56:35 +0000 (19:56 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Dec 2015 23:13:07 +0000 (23:13 +0000)
Instead of hard-coding the required Django version in the start
script, look it up from the toaster-requirements.txt file.

[YOCTO #8364]

(Bitbake rev: 2149ff805424692f9fde29618f2ae0eb99f710d2)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
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>
bitbake/bin/toaster

index e3c78675dc1e70669a8494b63f5e796c855e6c21..0862a3548ae285289f600b53f15d569c451b5c78 100755 (executable)
@@ -175,9 +175,15 @@ notify_chldexit() {
 
 verify_prereq() {
     # Verify prerequisites
+    regex="([0-9])\.([0-9])"
+    for line in `cat $BBBASEDIR/toaster-requirements.txt | grep Django` ; do
+        [[ `echo $line` =~ $regex ]]
+        required_major_version="${BASH_REMATCH[1]}"
+        required_minor_version="${BASH_REMATCH[2]}"
+    done
 
-    if ! echo "import django; print (1,) == django.VERSION[0:1] and django.VERSION[1:2][0] in (8,)" | python 2>/dev/null | grep True >/dev/null; then
-        printf "This program needs Django 1.8. Please install with\n\npip install django<=1.8.7\n"
+    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
+        printf "This program needs Django $required_major_version.$required_minor_version. Please install with\n\npip install -r $BBBASEDIR/toaster-requirements.txt\n"
         return 2
     fi