diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-02-05 12:07:44 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-10 23:07:48 +0000 |
commit | 0c89846dafa229b5af9653d6e141011c35451825 (patch) | |
tree | 12c42dccf16a5f94202507b747899c2ed122c268 /bitbake/bin | |
parent | 202d808f890b03958cd6873486e6a37f3f437098 (diff) | |
download | poky-0c89846dafa229b5af9653d6e141011c35451825.tar.gz |
bitbake: toaster: enhancements for the startup sequence
This patch brings fixes and enhancements in the startup sequence.
- the dependency version checking is now correctly enforced when
starting in both modes
- fixed errors in looking up environment variables
- added message with 'daemon' program start location
- presenting menu for selecting config file
[YOCTO #7283]
[YOCTO #7291]
[YOCTO #7273]
(Bitbake rev: c5ddd9d88910857a1b745b1c237df0390dd56835)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/toaster | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index 6f7c6f09ea..c3b8633c25 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster | |||
@@ -126,17 +126,20 @@ function notify_chldexit() { | |||
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | # Verify prerequisites | 129 | function verify_prereq() { |
130 | # Verify prerequisites | ||
130 | 131 | ||
131 | 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 | 132 | 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 |
132 | echo -e "This program needs Django 1.5 or 1.6. Please install with\n\npip install django==1.6" | 133 | echo -e "This program needs Django 1.5 or 1.6. Please install with\n\npip install django==1.6\n" |
133 | return 2 | 134 | return 2 |
134 | fi | 135 | fi |
135 | 136 | ||
136 | if ! echo "import south; print [0,8,4] == map(int,south.__version__.split(\".\"))" | python 2>/dev/null | grep True >/dev/null; then | 137 | if ! echo "import south; print reduce(lambda x, y: 2 if x==2 else 0 if x == 0 else y, map(lambda x: 1+cmp(x[1]-x[0],0), zip([0,8,4], map(int,south.__version__.split(\".\"))))) > 0" | python 2>/dev/null | grep True >/dev/null; then |
137 | echo -e "This program needs South 0.8.4. Please install with\n\npip install south==0.8.4" | 138 | echo -e "This program needs South 0.8.4. Please install with\n\npip install south==0.8.4\n" |
138 | return 2 | 139 | return 2 |
139 | fi | 140 | fi |
141 | return 0 | ||
142 | } | ||
140 | 143 | ||
141 | 144 | ||
142 | # read command line parameters | 145 | # read command line parameters |
@@ -170,13 +173,18 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th | |||
170 | # We are called as standalone. We refuse to run in a build environment - we need the interactive mode for that. | 173 | # We are called as standalone. We refuse to run in a build environment - we need the interactive mode for that. |
171 | # Start just the web server, point the web browser to the interface, and start any Django services. | 174 | # Start just the web server, point the web browser to the interface, and start any Django services. |
172 | 175 | ||
176 | if ! verify_prereq; then | ||
177 | echo -e "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; | ||
178 | exit 1; | ||
179 | fi | ||
180 | |||
173 | if [ -n "$BUILDDIR" ]; then | 181 | if [ -n "$BUILDDIR" ]; then |
174 | echo -e "Error: It looks like you sourced oe-init-build-env. Toaster cannot start in build mode from an oe-core build environment. You can work around this problem by starting Toaster from a new terminal window." 1>&2; | 182 | echo -e "Error: It looks like you sourced oe-init-build-env. Toaster cannot start in build mode from an oe-core build environment.\n You should be starting Toaster from a new terminal window." 1>&2; |
175 | exit 1; | 183 | exit 1; |
176 | fi | 184 | fi |
177 | 185 | ||
178 | if [ "x`which daemon`" == "x" ]; then | 186 | if [ "x`which daemon`" == "x" ]; then |
179 | echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program." 1>&2; | 187 | echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program from your distribution repositories or http://www.libslack.org/daemon/" 1>&2; |
180 | exit 1; | 188 | exit 1; |
181 | fi | 189 | fi |
182 | 190 | ||
@@ -208,6 +216,13 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th | |||
208 | exit 0 | 216 | exit 0 |
209 | fi | 217 | fi |
210 | 218 | ||
219 | |||
220 | if ! verify_prereq; then | ||
221 | echo -e "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; | ||
222 | return 1; | ||
223 | fi | ||
224 | |||
225 | |||
211 | # We make sure we're running in the current shell and in a good environment | 226 | # We make sure we're running in the current shell and in a good environment |
212 | if [ -z "$BUILDDIR" ] || [ -z `which bitbake` ]; then | 227 | if [ -z "$BUILDDIR" ] || [ -z `which bitbake` ]; then |
213 | echo "Error: Build environment is not setup or bitbake is not in path." 1>&2; | 228 | echo "Error: Build environment is not setup or bitbake is not in path." 1>&2; |