[bitbake-devel] [PATCH 10/18] toaster: Check Django version against toaster-requirements.txt

brian avery avery.brian at gmail.com
Thu Dec 10 03:56:35 UTC 2015


From: Elliot Smith <elliot.smith at intel.com>

Instead of hard-coding the required Django version in the start
script, look it up from the toaster-requirements.txt file.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith at intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
Signed-off-by: brian avery <avery.brian at gmail.com>
---
 bin/toaster | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/toaster b/bin/toaster
index e3c7867..0862a35 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -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
 
-- 
1.9.1




More information about the bitbake-devel mailing list