diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-07-17 15:30:17 +0100 |
---|---|---|
committer | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-07-23 18:13:05 +0100 |
commit | b5789c7ea7e6d1a4b67ec60fc0e4233ec543ba3a (patch) | |
tree | c4d798adc6888b7a6e2af1bd975788bb24b886aa | |
parent | 1868d5635b517e0fe1b874674ea7a78910b26e2e (diff) | |
download | bitbake-contrib-b5789c7ea7e6d1a4b67ec60fc0e4233ec543ba3a.tar.gz |
toaster-requirements.txt: document requirements for the python environment
Since Toaster adds a number of specific requirements managed
by pip, we document these requirements in order to be able
to run bitbake and toaster under virtualenv. The target here
is to break the dependency on distro packages for specific
python libraries.
In order to start bitbake/Toaster in a distro-independent manner,
we use virtualenv and pip. We add venv to the .gitignore list
to make room for the virtualenv deployment in this directory.
Use this command sequence to setup the virtualenv:
$ virtualenv venv
$ . venv/bin/activate
$ cat toaster-requirements.txt | xargs pip install
bitbake and Toaster will then run normally under virtualenv.
We also fix bugs related to toaster starting in managed mode
through this script:
* toaster will not use bldcontrol application in interactive mode
* a proper message will be displayed if toaster detects a managed
start request in a build environment
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | bin/toaster | 19 | ||||
-rw-r--r-- | toaster-requirements.txt | 4 |
3 files changed, 17 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore index 5d9bc50d2..5adf4d1a3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ pyshtables.py /bin/bitbakec *.swp tags +*.sqlite +venv/ doc/bitbake-user-manual/bitbake-user-manual.html doc/bitbake-user-manual/bitbake-user-manual.pdf doc/bitbake-user-manual/bitbake-user-manual.tgz diff --git a/bin/toaster b/bin/toaster index 1f90362b1..ce16de6c3 100755 --- a/bin/toaster +++ b/bin/toaster @@ -63,9 +63,11 @@ function webserverStartAll() retval=0 python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1 fi - python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1 - python $BBBASEDIR/lib/toaster/manage.py checksettings || retval=1 - + if [ "x$TOASTER_MANAGED" == "x1" ]; then + python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1 + python $BBBASEDIR/lib/toaster/manage.py checksettings || retval=1 + fi + echo "Starting webserver" if [ $retval -eq 0 ]; then python $BBBASEDIR/lib/toaster/manage.py runserver 0.0.0.0:8000 </dev/null >${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid sleep 1 @@ -128,8 +130,8 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th # Start just the web server, point the web browser to the interface, and start any Django services. if [ -n "$BUILDDIR" ]; then - echo "Error: build/ directory detected. Standalone Toaster will not start in a build environment." 1>&2; - return 1; + echo -e "Error: build/ directory detected. Toaster will not start in managed mode if a build environment is detected.\nUse a clean terminal to start Toaster." 1>&2; + exit 1; fi # Define a fake builddir where only the pid files are actually created. No real builds will take place here. @@ -140,6 +142,7 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th webserverKillAll RUNNING=0 } + TOASTER_MANAGED=1 export TOASTER_MANAGED=1 webserverStartAll || (echo "Fail to start the web server, stopping" 1>&2 && exit 1) xdg-open http://0.0.0.0:8000/ >/dev/null 2>&1 & @@ -163,13 +166,13 @@ fi # Verify prerequisites -if ! echo "import django; print (1,5) == django.VERSION[0:2]" | python 2>/dev/null | grep True >/dev/null; then - echo -e "This program needs Django 1.5. Please install with\n\nsudo pip install django==1.5" +if ! echo "import django; print (1,) == django.VERSION[0:1] and django.VERSION[1:2][0] in (5,6)" | python 2>/dev/null | grep True >/dev/null; then + echo -e "This program needs Django 1.5 or 1.6. Please install with\n\npip install django==1.6" return 2 fi if ! echo "import south; print [0,8,4] == map(int,south.__version__.split(\".\"))" | python 2>/dev/null | grep True >/dev/null; then - echo -e "This program needs South 0.8.4. Please install with\n\nsudo pip install south==0.8.4" + echo -e "This program needs South 0.8.4. Please install with\n\npip install south==0.8.4" return 2 fi diff --git a/toaster-requirements.txt b/toaster-requirements.txt new file mode 100644 index 000000000..19b529372 --- /dev/null +++ b/toaster-requirements.txt @@ -0,0 +1,4 @@ +Django==1.6 +South==0.8.4 +argparse==1.2.1 +wsgiref==0.1.2 |